Alice Community  

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

Reply
 
Thread Tools Display Modes
Frogger Help
Old
dropdead2112
Guest
 
Status:
Posts: n/a
Default Frogger Help - 04-13-2011, 09:20 PM

I am working on a frogger like program, and I need just a little help. I already setup the world, and got the frog jumping. But I want to move the lilly pads from left to right, randomly.
So far I have the list of the 5 pads that you have to jump on and got them moving randomly. The problem I am coming up with is that when the pads go to the left or right they don't stop. Is there a way to make a boundry to make them go to the left a certain distance than stop, same with the right.

Thanks for the help.
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 09:44 PM

are the pads moving as a group? are they separate? you could use an if statement within an infinite loop that runs when the world is created
Code:
    if(pad.position.x > boundary.x){


            move pad in opposite direction

}
although im not quite sure how to refer to the x coord in the position of the pad. i just started alice yesterday and as far as object properties are concerned i only see point of view. can anyone provide any insight as to if you can refer to a Vector3 quantity for the position of an object? it seems almost necessary that you have access t0 that
   
Reply With Quote
Old
dropdead2112
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 10:07 PM

Thanks. That actually helped a lot, I'm still working on the boundaries, but when I come up with the final solution I will post it for others if they need help!
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 10:32 PM

cool glad it helped you out. im still searchin around for how to get that position vector, i see it in the point of view but i cant find it anywhere on its own.
   
Reply With Quote
Old
dropdead2112
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 11:27 PM

If you look under functions for the selected object you will see:
Code:
<OBJECT> position
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-13-2011, 11:29 PM

oh ok sweet. can you select which coordinate of the vector you want to manipulate?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 04-14-2011, 12:41 AM

Dead end. That function cannot be manipulated in any way unless you'd like to send the object to the world's origin, which would rarely be helpful.

You can set up two dummy objects, one representing each boundary, and have each lily pad simply switch directions when it goes past the dummy objects.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Default 04-14-2011, 06:29 AM

You could just have it move right or left a fixed distance, and have the time it takes be a variable so that some lily pads move faster than others.


Last edited by debussybunny563; 12-21-2012 at 12:00 AM.

|--------------------------------------------------------------------------------------------------|
|Link to weapons collection: http://www.alice.org/community/showthread.php?t=7368 |
|--------------------------------------------------------------------------------------------------|

I have been dead for quite some time now; not much hope for resurrection.
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-14-2011, 08:42 AM

Quote:
Originally Posted by debussybunny563 View Post
You could just have it move right or left a fixed distance, and have the time it takes be a variable so that some lily pads move faster than others.
this is probably the easiest way to do it
   
Reply With Quote
Old
dropdead2112
Guest
 
Status:
Posts: n/a
Default 04-16-2011, 10:31 PM

Yeah I just finished it and turned it in. I used the fixed distance way. That seemed to be the easiest and work out real well.

Thanks everyone for your help!!
   
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 ©2021, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.