Skip to content

Commit

Permalink
fixes (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
rufio72 committed Nov 21, 2020
1 parent 52f2855 commit 3adcfb5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/game/physics.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ function physics:swing(object,dt)
object.reverse = false
end
end

object.x_old = object.x
object.x = object.radius * math.cos(object.angle) + object.xorigin
object.x_dist = object.x - object.x_old

object.y_old = object.y
object.y = object.radius * math.sin(object.angle) + object.yorigin
object.y_dist = object.y - object.y_old
end


Expand Down Expand Up @@ -382,10 +386,11 @@ function physics:platforms(object, dt)
end

if platform.swing then
object.newX = platform.radius * math.cos(platform.angle) + platform.xorigin +platform.w/2 - object.w/2
-- object.newX = platform.radius * math.cos(platform.angle) + platform.xorigin +platform.w/2 - object.w/2
object.newX = object.newX + platform.x_dist
object.newY = platform.y - object.h+1 *dt
object.yvel = -player.jumpheight
object.xvel = 0
-- object.xvel = 0
end

if platform.movey and not object.jumping then
Expand Down

0 comments on commit 3adcfb5

Please sign in to comment.