Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Visual Rock Paper Scissors

Author
Message
Shaky Badger
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 3rd Dec 2007 09:09 Edited at: 4th Dec 2007 02:46
So i'm making a game of visual rock paper scissors, essentially i scanned in a bunch of hand drawn pictures and was going to use them to illustrate my game. I input the drawn pictures using the Load Image command, and then attempted to put some hidden sprites in there on my pictures around areas your supposed to be able to click. my problem is, when i want to change the background, it doesn't seem to get rid of the hidden sprites, so you can still click them and they continually layer on there.. I need to figure out where/how i can upload all my pictures so maybe anyone/everyone could run it and see what issues i'm having. Also my random number generator isn't working either, it always returns a value of 3, and its driving me nuts.. I'm open to any and all suggestions, i'll post the code and try to add the pictures once i get a chance later on tonight.

If anyone could help with my randomized numbers or give any overall suggestions on where it looks like i've gone wrong, i'm more then happy to give any ideas a shot cause i'm completely out of ideas.

Also i'm relatively new to DBPro, so theres alot i'm unaware of.





hopefully these images will turn out okay? I'm not sure if i should post links or what.. so i think i'm going to link, to save people loading time? not sure about the etiquitte.

badgering since 1986
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 3rd Dec 2007 23:00 Edited at: 3rd Dec 2007 23:50
no time to dl the images and work with your code right now but:

Quote: "
...my random number generator isn't working either, it always returns a value of 3"


can be fixed by the randomize command which uses a seed of your choice. most people seed it with timer() because timer() returns the current system time in miliseconds, which is different every time you call it (unless you happen to call it at the exact same time every day, that is ). so, those 2 dbpro commands used together will provide a (nearly) completely random number.

you can "initialize" or set the seed at the beginning of your application, or re-seed it in a loop, etc, as follows:

randomize timer()

good luck!

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP
Shaky Badger
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 4th Dec 2007 01:04
I've decided to ditch the sprite collision and head the direction that if mousex/mousey are within the right area and you click, then it goes to the next screen etc etc.. and i think i figured out the issue with the randomized number, it was constantly in some loop or the other so i made it a global variable so it can just be pulled into whichever function i decide to put it in, i think that will fix it, if i get it all working right i'll be sure to post the code, just for kicks. anywho thanks for the advice and taking the time to read my post

badgering since 1986
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 4th Dec 2007 01:46
hmmm... well, i downloaded the images and found that you're missing a number of images that your program is calling. i began making stand-ins (the "select" images) and found that you're missing even more. also, you're loading bmp files in your program and giving us jpg's to work with. yah, we could view each and save as bmp but that's taking more time than most are willing to offer. so... i recommend getting a complete image set together and zipping them all up and attaching them to the post.

i'll attach the "select" (x3) and "win" images that i slapped together. you can use them or make your own.

Virtual Nomad
AMD XP 1800+ (~1.6 Ghz) / 1.5 GB RAM
ATI Radeon 8700LE 128 MB / Windows XP

Attachments

Login to view attachments
Shaky Badger
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 4th Dec 2007 02:45
Crap, sorry about that, i've got'em all saved and edited as bitmap, the ones i posted arent even the right size, unfortunately i cant zip anything on the computer i'm on, but i'll try and repost the correct images and some new code that i've been working on that should be much much easier to follow at least.

I'm having problems getting myself stuck in loops, which seems to be a real issue for me. And i've gotten rid of the sprites way of doing it, which i think will help alot.. I've tried to use gotos in this version, instead of functions, but that can be easily changed, and also the win/lose/draw functions/gotos/whatevers arent completed yet as I would like to get the rest to at least go through start ==> choose R/P/S ==> show RvsP image ==> then wait a few seconds and say you win/lose/draw... Again thanks for any insight about where things might be going awry. My biggest problem seems to be this: I want it to go to the start screen, and when i click start I want the new screen to appear and the program to forget about the start screen and the mouseclick statements in it.. and then focus on the newscreen and where the mouseclick statements are at on it. (if that makes any sense) but everytime I do anything i never seem to be able to get it to ignore my old click statements, so if i click in one place where the two statements overlap theres problems. I hope that was clear enough to follow.





















badgering since 1986
Shaky Badger
17
Years of Service
User Offline
Joined: 18th Nov 2007
Location:
Posted: 4th Dec 2007 02:53
sorry about the many posts, but i cant edit my old posts are they're not up yet, i was wrong, i can zip things, here are the images for download.

badgering since 1986

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-26 06:29:20
Your offset time is: 2024-11-26 06:29:20