Alice Community  

Go Back   Alice Community > Alice 2 > Works-In-Progress

Reply
 
Thread Tools Display Modes
Need Help Recusion
Old
bmarh
Guest
 
Status:
Posts: n/a
Default Need Help Recusion - 09-18-2010, 04:51 PM

Create a sea world with a boat and an island. Position the island some distance away from the boat, as shown in Figure 8-26. Write a method named sailTo, which has an Object parameter. The method should cause the boat to move one meter toward the object and then recursively call itself until the boat has reachedthe object. Test the method by calling it and passing the island as the argument

my my will stop at the Island.
   
Reply With Quote
Old
debussybunny563
Senior Member
 
debussybunny563's Avatar
 
Status: Offline
Posts: 852
Join Date: May 2010
Arrow 09-18-2010, 06:50 PM

I made an example.

Credit goes to Arty-fishL for the WONDERFUL and amazing looking sea scene.
I just made the sailboat and the sailTo method.
Attached Files
File Type: a2w sailboat_recursion.a2w (1.30 MB, 200 views)


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
NukeGunner
Junior Member
 
Status: Offline
Posts: 2
Join Date: Apr 2012
Default 05-20-2012, 06:47 AM

Cool scene.
How is the program making the sail boat turn toward the island though?
How is the program stoping when the sail boat is at the island.
   
Reply With Quote
Old
smithjas
Member
 
smithjas's Avatar
 
Status: Offline
Posts: 23
Join Date: Mar 2012
Default 05-20-2012, 10:29 AM

The scene is wonderful
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.