diff --git a/src/bytecode.go b/src/bytecode.go index 40dea5c2..02834baa 100644 --- a/src/bytecode.go +++ b/src/bytecode.go @@ -1791,7 +1791,7 @@ func (be BytecodeExp) run(c *Char) BytecodeValue { case OC_pos_x: sys.bcStack.PushF((c.pos[0]*(c.localscl/oc.localscl) - sys.cam.Pos[0]/oc.localscl)) case OC_pos_y: - sys.bcStack.PushF((c.pos[1] + c.groundLevel - c.platformPosY) * (c.localscl / oc.localscl)) + sys.bcStack.PushF((c.pos[1] - c.groundLevel - c.platformPosY) * (c.localscl / oc.localscl)) case OC_power: sys.bcStack.PushI(c.getPower()) case OC_powermax: diff --git a/src/stage.go b/src/stage.go index 34100fad..2973cbae 100644 --- a/src/stage.go +++ b/src/stage.go @@ -403,7 +403,7 @@ func (bg backGround) draw(pos [2]float32, drawscl, bgscl, stglscl float32, y := bg.start[1] - yScrollPos + bg.bga.offset[1] // Calculate Y scaling based on vertical scroll position and delta - ys2 := bg.scaledelta[1] * pos[1] * bg.delta[1] * bgscl + ys2 := bg.scaledelta[1] * pos[1] * bg.delta[1] * bgscl / drawscl ys := ((100-(pos[1])*bg.yscaledelta)*bgscl/bg.yscalestart)*bg.scalestart[1] + ys2 xs := bg.scaledelta[0] * pos[0] * bg.delta[0] * bgscl x *= bgscl