Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   How do make a person move around screen randomly? (http://www.alice.org/community/showthread.php?t=6664)

GrungeX 05-30-2011 07:31 PM

How do make a person move around screen randomly?
 
Hey guys! I'm making a shooting game...you have to shoot the character 10 times to kill him. I don't want it to be easy, so I want the character to move around the map randomly. How would the code for this work?

DeathxKiller 05-30-2011 07:48 PM

[QUOTE=GrungeX;36695]Hey guys! I'm making a shooting game...you have to shoot the character 10 times to kill him. I don't want it to be easy, so I want the character to move around the map randomly. How would the code for this work?[/QUOTE]
do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some

Merangeudie1 05-30-2011 08:01 PM

[QUOTE=DeathxKiller;36697]do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some[/QUOTE]

the random number can be found under world in functions.

forgot to mention that you never know :)

chip 05-30-2011 08:55 PM

If you want to make it even more difficult and are using a projectile-type weapon, try using some code that detects the projectile's proximity to the enemy and then have the enemy dodge it. You can use the random function to control how effective the dodge is.

DeathxKiller 06-02-2011 11:55 AM

[QUOTE=DeathxKiller;36697]do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some[/QUOTE]

the reason why you need the negative numbers is that you won't need to do right and backward methods as well. oh and do a WHILE statement and do a variable that is named HEALTH and do While [Health>0] do above method^^^


All times are GMT -5. The time now is 11:22 PM.

Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.