Donkey Kong terrain question

11 views
Skip to first unread message

nram...@ellingtonps.net

unread,
Dec 3, 2014, 7:58:52 AM12/3/14
to starlo...@googlegroups.com
I have a group that is interested in using a donkey kong theme for their two-player game design. I have attached the image that they are using for inspiration. They are wondering if there is a way to randomize the route of the barrels that donkey kong throws. For example, sometimes they might go down the ladder, and other times not.
 
Thank you!
donkey kong.jpg

Daniel Wendel

unread,
Dec 3, 2014, 12:02:18 PM12/3/14
to starlo...@googlegroups.com
Yes! Use the random block, which gives a number between 1 and whatever you give it. For example,

if <random 2> = <1>
  [go down the ladder]
else
  [go sideways]

Random 2 will give either a 1 or a 2 with equal probability. So random 2 will be equal to 1 about 50% of the time. That means 1/2 the time the code for going down the ladder will run, and 1/2 the time the code for going sideways will run.

--Daniel

On Wed, Dec 3, 2014 at 7:58 AM, <nram...@ellingtonps.net> wrote:
I have a group that is interested in using a donkey kong theme for their two-player game design. I have attached the image that they are using for inspiration. They are wondering if there is a way to randomize the route of the barrels that donkey kong throws. For example, sometimes they might go down the ladder, and other times not.
 
Thank you!

--
You received this message because you are subscribed to the Google Groups "StarLogo TNG" group.
To unsubscribe from this group and stop receiving emails from it, send an email to starlogo-tng...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

nram...@ellingtonps.net

unread,
Dec 3, 2014, 12:43:11 PM12/3/14
to starlo...@googlegroups.com
Thanks so much!
Reply all
Reply to author
Forward
0 new messages