Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
How do make a person move around screen randomly?
Old
GrungeX
Guest
 
Status:
Posts: n/a
Default How do make a person move around screen randomly? - 05-30-2011, 08:31 PM

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?
   
Reply With Quote
Old
DeathxKiller
Senior Member
 
DeathxKiller's Avatar
 
Status: Offline
Posts: 53
Join Date: May 2011
Location: Midlothian
Default 05-30-2011, 08:48 PM

Quote:
Originally Posted by GrungeX View Post
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?
do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some
   
Reply With Quote
Old
Merangeudie1
Guest
 
Status:
Posts: n/a
Default 05-30-2011, 09:01 PM

Quote:
Originally Posted by DeathxKiller View Post
do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some
the random number can be found under world in functions.

forgot to mention that you never know
   
Reply With Quote
Old
chip
Member
 
chip's Avatar
 
Status: Offline
Posts: 24
Join Date: May 2011
Location: New Hampshire
Default 05-30-2011, 09: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.
   
Reply With Quote
Old
DeathxKiller
Senior Member
 
DeathxKiller's Avatar
 
Status: Offline
Posts: 53
Join Date: May 2011
Location: Midlothian
Default 06-02-2011, 12:55 PM

Quote:
Originally Posted by DeathxKiller View Post
do together:
object move[left][random][mininum(-#)][maximum(#)]
object move[forward][random][mininum(-#)]{maxinum(#)]

hope this helped some
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^^^
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



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