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

Chip's Challenge

Name: Anonymous 2011-02-22 1:46

So some guy comes along and asks you to remake Chip's Challenge for him.  He lets you do it in whatever language you want.  You can organize the code however you want.  The catch is this:

You need to be able to add new tiles easily.

How do you approach this /prog/?

Name: Anonymous 2011-02-22 2:53

I use python & pygame to code.  I have a base tile class that one can derive other tiles from.  A folder called tiles[/coder] will hold the tile classes in separate .py files.  Each class will have an internal variable that is a single character.

Levels are stored in plain text in a grid like so:
[code]
xxxxxax
xxxxxax
xaaaaax
xxxxxxx


Before loading the level, the program will search and import each class from that directory and make a directory of characters linked to a reference the to class.

Iterating through each character, it will match the corresponding class and make instances of it.

btw this question is incredibly vague.  wtf do you mean easily?  Easy for a coder?  Easy for an average player?

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