Alice Community  

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

Reply
 
Thread Tools Display Modes
belly slide
Old
clumpy
Guest
 
Status:
Posts: n/a
Default belly slide - 12-09-2009, 09:09 AM

Hi people, i was hoping to get some help by someone with how to get a penguin to slide down the hill to a lake.
i have done some coding but its not working how i want it to.
What i have to do is get the pen to slide down the hill to the "circle" (pool) and the go "down" so it looks like he has gone for a swim.
for my coding what happens is the penguin goes down at a "random amount" and then goes past the circle and comes back and fourth for a while. i dont know how i can recode this so when the penguin reahces the middle of the "circle" to stop.
can anyone help me?
thanks
   
Reply With Quote
Old
Apollo
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 09:57 AM

Do you have a screen shot of the actual code? That way we can look at it and try and see where your error is.
   
Reply With Quote
Old
clumpy
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 03:04 PM

Quote:
Originally Posted by Apollo View Post
Do you have a screen shot of the actual code? That way we can look at it and try and see where your error is.
yeah i do, i will post one just now
Attached Images
File Type: jpg Untitled.jpg (89.2 KB, 146 views)
   
Reply With Quote
Old
Danny
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 04:39 PM

I'm actually doing the same sort of problem right now as well, how did you get the item to actually slide down the slope? My one always seems to fly through the air toward the target.
   
Reply With Quote
Old
Apollo
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 05:36 PM

I'm not sure, but I think it may have something to do with the min/max values in the random move. E.g The penguin could be 0.31 away from the circle but then it will move atleast 1m toward the circle making the difference 1.3.
   
Reply With Quote
Old
clumpy
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 05:48 PM

Quote:
Originally Posted by Danny View Post
I'm actually doing the same sort of problem right now as well, how did you get the item to actually slide down the slope? My one always seems to fly through the air toward the target.
if you look at my coding it is there for you i have done some more which seems ok but i have found out i have to do more stuff within the programme and this stuff is messing everything up


what i need to do is make one even but i have three and when i try and make one event everything goes belly up :-(
Attached Images
File Type: jpg Untitled22.jpg (100.1 KB, 139 views)

Last edited by x2495iiii; 12-10-2009 at 06:34 AM.
   
Reply With Quote
Old
steveb
Guest
 
Status:
Posts: n/a
Default 12-09-2009, 09:33 PM

what you hsve to do is place a parameter in your penguin slide method. Then you have one event. Which is: When mouse is clicked on anything do penguin slide(who(which is the parameter). You should have only one method for penguin slide but with a parameter. I had mine as a class level method, but I believe it should have been world level due to the fact more than one object was used(3 penguins). It still works. Hope this helps
   
Reply With Quote
Old
clumpy
Guest
 
Status:
Posts: n/a
Default 12-10-2009, 06:16 AM

Quote:
Originally Posted by steveb View Post
what you hsve to do is place a parameter in your penguin slide method. Then you have one event. Which is: When mouse is clicked on anything do penguin slide(who(which is the parameter). You should have only one method for penguin slide but with a parameter. I had mine as a class level method, but I believe it should have been world level due to the fact more than one object was used(3 penguins). It still works. Hope this helps
i must be getting confused somewhere because i have tried this and only one of the penguins move.
I need when the user clicks on whichever penguin he wants then the penguin will do a bellyslide down to the pool.
   
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 12-10-2009, 06:33 AM

Steve b had the right idea, but did you use the object under mouse cursor expression for the parameter's initial value when the method is called?

I've attached an example.
Attached Files
File Type: a2w clickSelect.a2w (834.1 KB, 95 views)


(')>
   
Reply With Quote
Old
clumpy
Guest
 
Status:
Posts: n/a
Default 12-10-2009, 06:47 AM

Quote:
Originally Posted by x2495iiii View Post
Steve b had the right idea, but did you use the object under mouse cursor expression for the parameter's initial value when the method is called?

I've attached an example.
i made a whichPenguin object.Replaced all the penguins within my code and when i try and play it it says "subject must not be null"
   
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.