Retrieving items

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
exicscarecrow
Prole
Posts: 1
Joined: Wed May 15, 2013 6:40 pm

Retrieving items

Post 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. :)
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Retrieving items

Post by Roland_Yonaba »

You just need a bit of randomness in your constant world.
See math.random section in this article.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests