I want to make a game based on the samarai warriors, and i am using al for enemies and allies, i think i already have the scripts for enemies and allies but the al movement is the struggle, I want them to move on their own and show there place on a small map, how do i do it?
Offline
Hmm… I know you can have it so if they are a certain distance away you can see them, as for the map… make the markers move like the AI's. I'm no expert at doing that kinda stuff though
Offline
a bit like zombiepox?
Offline
Ok, start off with your samurai on the board, then have a little dot or something on the map. Lets say they both start on the center of the map, and center of screen. If the map is in the lower right corner of the screen, and is 50 pixels long, while the screen is... lets say 250, you need to make the little red dot move 1/5th the speed as the samurai in X. Find the same ratio for y, and then start your little dot in the senter of the map. Ill try writing it out and seeing how it works. Example:
Samurai:
When Clicked:
Go to 0,0
Forever:
Set SamuraiX to Xposition/5
Set SamuraiY to Yposition/4
Repeat 10
Change X by 10
Repeat 10
Change Y by 10
Now for the map indicator.
When clicked
forever
set x to SamuraiX+150
sey y to SamuraiY-100
(All of these number were just examples, use certain numbers for where your map is, and where your samurai is.
Offline
An AI for a fighting opponent will be interesting but difficult. If you made it permanently attacking but it only does damage when it touches you that would keep things simpler.
goodluck
Offline
newareagle wrote:
Ok, start off with your samurai on the board, then have a little dot or something on the map. Lets say they both start on the center of the map, and center of screen. If the map is in the lower right corner of the screen, and is 50 pixels long, while the screen is... lets say 250, you need to make the little red dot move 1/5th the speed as the samurai in X. Find the same ratio for y, and then start your little dot in the senter of the map. Ill try writing it out and seeing how it works. Example:
Samurai:
When Clicked:
Go to 0,0
Forever:
Set SamuraiX to Xposition/5
Set SamuraiY to Yposition/4
Repeat 10
Change X by 10
Repeat 10
Change Y by 10
Now for the map indicator.
When clicked
forever
set x to SamuraiX+150
sey y to SamuraiY-100
(All of these number were just examples, use certain numbers for where your map is, and where your samurai is.
I see how this would work if you use the arrow keys, but how will this work when the character is following the mouse cursor? (like wandering knight) how can the dot move exactly like the character yey not follow the cursor
http://scratch.mit.edu/projects/Freestylin_Monkey/204983
Last edited by Freestylin_Monkey (2008-07-10 13:38:31)
Offline