Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Zerk

1
Posts
1
Topics
1
Followers
1
Following
A member registered Sep 08, 2020 · View creator page →

Creator of

Recent community posts

(2 edits)

Hi MBoffin!

Thank you so much for taking the time to write all of these resources, i feel like they have not only helped me learn to become a better game designer, but a better developer overall.

I wanted to take some time to tell you that i found a bug in the cartridge for Movement with Inertia, and how to resolve that bug for anyone that might be stuck on it.

Problem Description

When the player character is above a tile that can be collided with, they can move left, right and up, but not down. This is expected.

When the player moves down-right, they cannot move down until they clear the right-edge of the collideable tile. once they clear this edge, the player character move down-right.

When the player moves down-left, once they reach the left-edge of the tile, ALL MOVEMENT CEASES while the player is holding down.


Fix

Looking over the code i found that on line 292-293, there is a check during the "doing down?" elseif check to define two local variables: one for the bottom-left edge of the tile, and one for the bottom-right edge.

local wall_btm_left=solid(a.x,a.y+a.h+1)
local wall_btm_right=solid(a.x,a.y+a.h+1)

the wall_btm_right variable appears to not be adding the width of the player (a.w), thus wall_btm_right is essentially the same check as wall_btm_left!

Once the code was updated with a.w, everything worked as expected.

local wall_btm_left=solid(a.x,a.y+a.h+1)
local wall_btm_right=solid(a.x+a.w,a.y+a.h+1)



I hope this helps anyone that might've been stuck or confused, it certainly had me scratching my head for a minute, but it was an amazing educational experience to scan through the code, understand it fully, find this issue and fix it. 


Thank you so much again, MBoffin!