Coding for future expansion..

15

Im sure most people know this, but I also know there are a lot of people on here who are still learning.. TIps and tricks are always a good thing to pay attention too.. You may not need the info now, but who knows about the future.. One thing that this brings to mind, is coding for future changes..

Im still working on my gamejam game. $#^%! as if I needed another project.. I like it, and im going to turn it into a full released game for windows 8.. but.. because I was on a time limit, i cut corners.. Bad Dev! BAD!!!!

So what happened is I ended up hardcoding a LOT of variables into the game, never expecting the mechanics to change.. BAD DEV! BAD!

Lesson 1: Things change.. and things changing can be good.. or bad.. Now, in my code I planned to only ever have 1 shark on the screen.. Now, I want to change that.. Problem: I hardcoded all of those variables and that carried over to the logic.. So now I have to rewrite and refigure things because instead of using proper OOP and putting my player into a class in the first place, Im having to redo a bunch of code.. So .. always always always use proper OOP and coding techniques and plan for things that might change.. You may never think you will need 8 players on the screen... until the day you do and your hardcoded to 3..

repeat after me...

Classes iz gooood.. OOP iz gooood...

Now, moving on.. I have more sharks to go implement.. and i have cured my boredom, so back to coding.. instead of working..

12
Jimmy Hurstel #50 20 194

Been there, been a victim of that! Creating a parent obect is always a good idea. On these smaller titles I have been working on I find my self deving on the fly. So it’s vital that I live by this bit of advice because things like to change. Emergent gameplay happens and to be honest a lot of the time my prototypes are not fun at first and tweaks need to be made.

18
Tim Ruswick #1 89 2068

Omg yesss. When I started programming I hardcoded all sorts of numbers and It was a NIGHTMARE to work with.

Now not only do I use variables and arrays and OOP as much as I can, but I also try and keep important variables in external files so I can tweak games without recompiling or chaning code...Plus it makes it fun for the players to be able to mod stuff with text files.

Good tip dude!

11
50/50 Studios #118 4 108

I always fall into a similar trap, smart enough to start out with OOP programing and classes and such, but as the deadline gets closer code gets sloppier, corner become curved edges made out of jagged glass and the finished product may look like a diamond on the outside but on the inside it's paper mache.

Showing 1 - 5 of 5