Help platformer hit detection

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
gfarrarthenoob
Prole
Posts: 2
Joined: Sun May 13, 2018 2:04 am

Help platformer hit detection

Post by gfarrarthenoob »

So when ever the player hits the top of the platform it will just stop moveing
the code
https://pastebin.com/GFpXjE7a
SPlice
Prole
Posts: 48
Joined: Thu Jul 28, 2011 8:53 am

Re: Help platformer hit detection

Post by SPlice »

You are only updating your position if your not on a box.
rework this

Code: Select all

if coln(box[i].x-5,box[i].w-5,box[i].y-5,box[i].h-5,new.x,new.y,player.w,player.h) == false then
        player.y = new.y
        player.x = new.x
      end
      
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 5 guests