Alice Community  

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

Reply
 
Thread Tools Display Modes
Scenario help.
Old
Spanky300
Guest
 
Status:
Posts: n/a
Default Scenario help. - 09-12-2006, 09:30 PM

Hey guys,

Strugglin big time with this assigment for school. We have been givin a alice file which has a wall with 3 animals behind it and we need to make the animals randomly move to 3 points (left, middle, right) and then pop up from behind the wall. It is like a target shooting game.

What do I do to set points to which they can move and how can I make them randomly move there?

Help would be much appreciated.
   
Reply With Quote
Use a random number!
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default Use a random number! - 09-12-2006, 10:37 PM

I would suggest using something along the lines of a small invisible object for the points, like maybe a cone with is showing set to false. As for making them randomly move, you'll need a nested set of if-else statements and a random number generator. I post some code that might help you.

Last edited by Mr Nemo; 09-21-2006 at 10:09 PM.
   
Reply With Quote
The code
Old
Mr Nemo
Guest
 
Status:
Posts: n/a
Default The code - 09-12-2006, 10:49 PM

Here's the code of which I spoke. There a couple of things you'll have to work out on your own, such as getting the objects to move to UNIQUE locations rather than moving to one or two locations only.
Attached Files
File Type: zip RandomLocation.zip (4.2 KB, 388 views)
   
Reply With Quote
Old
Star wars fan
Guest
 
Status:
Posts: n/a
Default 09-21-2006, 08:42 PM

this might help with this whack a mole game I'm making just to get the hang of progrraming (I was almost done but saved over it ops) before I just had them in a square which is preety easy to predict
   
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 ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.