So, this is the topic for my game baba is you hardware, where i will be posting bugs and new features! It is intended to make this arcade project into the full game baba is you, not every rule and so, but just a mini version you can play on the fly. (please pretend the nintendo switch version doesnt exist, thanks!)
This is what i have so far:
Custom tilemap engine
Auto arranging tiles
Pushable tiles and walls (issue with pushable tiles despawning fixed)
Baba (is you)
Spritesheets
Most spectacular and cool feature is of course the auto arranging tiles, here it is in its glory: (Its really simple but im really proud of it) (Also made walls pushable)
Also a bug:
When trying to undo a action, the tilemap wont change to the preveus tilemap. I dont know why this happens. I have tried changing the list from my tile class to a list of default values, and then stringifying and parsing it, to no avail. Even storing the list and then setting it again doesnt work for some reason.
Code under engine.ts
namespace engine {
export const canPush: string[] = ["box", "wall"]
export const wall: string[] = []
export let undos: any[][] = []
export function makeUndo() {
if (undos.length > 50) {
undos.removeAt(0)
}
undos.push([direction, spriteMap.getSpritesTile(baba), spriteMap.currentTileMap])
//currentTileMap = new spriteMap.tile()[]
}
export function doUndo() {
if (undos.length > 1) {
let temp = undos.pop()
if (temp) {
let map = temp[2]
let i = 0
spriteMap.currentTileMap = map
spriteMap.moveToTile(baba, temp[1])
direction = temp[0]
}
}
}
}