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:52

I choose sex.

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?

Name: Anonymous 2011-02-22 7:33

obviously the solution is to use C (game engine) + lua (tile effects):


tile_$(HEX).lua

Name: Anonymous 2011-02-22 13:01

>>3

Easy as in when you add a new tile:

-Minimize number of places you have to declare the new tile type
-Not worry about every other type of tile in existence
-Still be able to easily deal with certain tile-creature interactions (block x water, glider x water, etc)

Name: Anonymous 2011-02-22 14:49

>>5
That basically makes it impossible for many user-mods, there'd be like a few main interactions

1) ignore, passover
2) drown/explode
3) blocked, do nothing
4) follow x movement role for collision (go left, right, back, random)
5) follow exceptions as per the following rules:

5 would be where pretty much all of your bugs would be

I'd say the best example would be to look at the way Enigma does it, they have the basic block rules, then they also have a per-map basis for special situations. Not to say this is the easiest way to do it, but it would make it alot easier if rather than having blocks that could be put in to the general game, have blocks that would be pulled from special maps (imported), then have the engine ask what is the solution for the undefined interactions.

Name: Anonymous 2011-02-22 17:41

Supaplex > Chip's Challenge

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