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 / Random Enemy Location Question

Author
Message
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 30th Mar 2008 04:30
Ok, I have yet another question guys. I want it to find a random place on the screen for my enemy images...but I want it to be final fantasy style. So what I have come up with is a rnd that goes to 10 (just for practice purposes) and I made it paste the string value of each number in 32x32 blocks to fill up the screen like my map editor. What I want to know is how to figure out if your sprite is colliding with the number or if a mouse click is being clicked on a certain number.

The reason I need this is in final fantasy, you don't see the monsters, they are random. Is there an easier way to do this? Right now lets say it looks like this on screen (im not saying it is like this because it's random, its just an example)
Quote: "
0 1 2 3 4 5 6 7 8 9 10
"


Ok, so the strings are displayed on screen like that. What I need to know is to tell whenever the sprite or mouseclick is clicked on a certain one? (So like if mouse is clicked on 6, it prints "Winner") Don't think it's wierd, because that is how I learn better is to use it in a way like clicking, then I can turn it into collision later. Well thanks for any help.

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/
Paul08
16
Years of Service
User Offline
Joined: 20th Feb 2008
Location: Oxford, UK
Posted: 30th Mar 2008 17:06
Im a bit confused by the question - do you just mean something like:
if mouse x co-ordinate is > 10 and x co-ordinate is < 50
if mouse y co-ordinate is > 10 and y co-ord is < 20
if mouse left click then print "you clicked within the area"
endif
endif

? (code wont compile btw)

Paul
Jerok
19
Years of Service
User Offline
Joined: 7th May 2005
Location: Mars. Wait a sec I\'m on MARS. OMG
Posted: 30th Mar 2008 18:18
I am a bit confused to your question aswell. When you say
Quote: "The reason I need this is in final fantasy, you don't see the monsters, "

You mean while walking on the map before you enter a battle right. In this case the sprites arent actually positioned on the screen. In final fantasy the game sets a variable to 1 if the character is moving. Then it decreaces another variable by a certain amount while the moving variable is set to 1. Something like this:


Hope it helps
Destrugter 1
17
Years of Service
User Offline
Joined: 26th Oct 2006
Location:
Posted: 30th Mar 2008 18:46
ah thanks, you got it right jerok...that is what I meant...you encounter "Random" battles...guess they werent so random =P

do you love video games a lot ¿¿¿ then comeon down too game zone252 @ http://www.freewebs.com/gamezone252/

Login to post a reply

Server time is: 2024-09-27 12:22:05
Your offset time is: 2024-09-27 12:22:05