This site requires JavaScript, please enable it in your browser!
Greenfoot back

Report as inappropriate.

FlyingRabidUnicornPig presents ...



A work in progress support class that I'm making for my challenge entry later this month.
This scenario includes a Wind class that will push actors around based off of a speed, a range of wind speed, and specific actors resistances to the wind.
Move the foot around using "aswd". To increase the foot's resistance to the wind, press 1. To decrease, press 2.
You can make your own sand by dragging the mouse around. To increase the amount of sand you make, press the up arrow. Every time you press it it will add 1 more to the sand cluster. To decrease, press the down arrow.

To use the Wind class, you need the Wind class and the WindActor class. Use the add and remove methods to add and remove (who would've guessed) WindActors to the list of actors the Wind object affects. The WindActors need to accept a Wind class, and it will add itself to the Wind's list. Then you can choose the range of the wind's speed (0 to 1), the maximum speed (will go that fast if it reaches 1). You also need to supply an int that will specify a direction (currently only 4 directions).

In the future:
- At least 8 directions
- A better formula for resistance and wind flow

1645 views / 160 in the last 7 days

Tags: demo with-source

This scenario is a member of: Reusable Code from FRUP

open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on Thu Jul 04 16:22:17 UTC 2013 -Changed speed back to normal
A new version of this scenario was uploaded on Thu Jul 04 22:38:48 UTC 2013 Source code included

Want to leave a comment? You must first log in.

Who likes this?

No votes yet.