Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

was the box duplication on the spiral level, the one with two boxes stuck on the right or one of the last 3?
i know the spiral one can kill the player if you enter and the one with two boxes on the right can duplicate but i havent experienced any bugs in the last 3, thanks

Yeah, I think those are the two that I faced as well.

(+1)

the  conveyors took me forever to get working, before there were way more bugs with them that i fixed by rewriting the logic entirely using recursion 

Ah I see. I’m curious as to why it duplicates though? Do you create a new box every time instead of just moving the original one?

(+1)

i store the level as a hashmap where the key is the coordinate and the value is a struct containing the top and bottom tile
the conveyor logic goes like this:

for each conveyor in the map, check if its possible for it to move, and whether you would need to push an object (like if theres a box after the conveyor and theres empty space after the box, so the box will get pushed by whats on the conveyor)
i store this as an array of moves, then for each move i perform it, by setting the object in the end coordinate to the one that was in the start coordinate, then removing the object from the start coordinate only if theres no moves in the array which point to the start coordinate, or if an object needs to be pushed i call the move() function i have which i use for moving the player

its most likely an issue with the pushing mechanic, now i feel stupid for making the objects part of the map instead of in an array, since i iterate over that entire hashmap many times per frame/move, if i maintain this game i will remake this system but i only had ~3.5 days to make the game since i started late

TLDR;
im a complete idiot and i used a hashmap to store all the objects on the map lol

Ahh, I gotcha. Given that you started late, the jank is excusable I’d say. I had the whole week and still made terrible design choices in the code.