Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Refactoring

Name: Anonymous 2018-07-09 20:23

I am working on a game engine right now, and I want to redo the tile system so that every tile is an instance of a class, and each tile object maintains its own individual properties, like the image(s) that get displayed (there can be multiple layers), whether it's a blocking or non-blocking tile (for collision detection), any events (such as enemy encounters, NPCs, or moving the player to another map), etc. Then all I have to do is create a 2d array of these objects for the map.

But right now, my game has similar functionality (from the end user's standpoint), but the code base is a bunch of spaghetti. It's not modularized, not using the object stuff I was talking about, and the collision detection is a big if statement with a bunch of ORs to check for individual tiles instead of a boolean property within a tile object (like tileObj.isBlocking or something).

So should I start from the ground up, since I would have to redo so many things, or should I just refactor what I currently have? Or should I just try to add additional functionality on top of the spaghetti code?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List