Page 1 of 1

Retrieving items

Posted: Wed May 15, 2013 6:50 pm
by exicscarecrow
Hi guys, i'm new to the forum, and lurked for a couple days, but i can't seem to find anything about how to handle placing and picking up items. for an example, in Snake, the goal is to eat the mouse, but the snake is not supposed to run into itself. how would i randomize the placement of the mouse after the previous one has been eaten? thanks in advanced. :)

Re: Retrieving items

Posted: Wed May 15, 2013 7:22 pm
by Roland_Yonaba
You just need a bit of randomness in your constant world.
See math.random section in this article.