HitBox of items

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
Maltasparks
Prole
Posts: 2
Joined: Fri Feb 06, 2015 12:38 pm

HitBox of items

Post by Maltasparks »

Hi,
How can i make a hitbox of some items and objects? example, i have a tree that is randomly spawned in the 5000x5000 pixel world, the world is 2d but you can move up, down, left, right, just like an mmo. So when the character comes near a tree, the tree would block him and he needs to go around it.
Thanks
User avatar
Doctory
Party member
Posts: 441
Joined: Fri Dec 27, 2013 4:53 pm

Re: HitBox of items

Post by Doctory »

try bump by kikito. it is really simple to use and works flawlessly.
theres an example here to get you started.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: HitBox of items

Post by s-ol »

This is called collision detection. There are tutorials on the wiki, tutorials in the forum, libraries on the wiki, libraries on the forum and questions on the forum. Please put some effort into searching for something as common as this before starting a thread and waiting for people to give you the answer you would literally find in less than 10 minutes on your own.

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
Post Reply

Who is online

Users browsing this forum: Bing [Bot], YaCy [Bot] and 13 guests