Kovak / CBL_SECRET_PROTOTYPE_RUNNING_GAME

0 stars 0 forks source link

Unit Tests #35

Open Kovak opened 11 years ago

Kovak commented 11 years ago

I think there might actually be a good way to write a unit test for the game.

Why don't we write a deterministic "level" of a length of like 3 to 5 minutes

The truth is this could be done by using the random generator but then saving the results somehow so we could just load up those exact same things.

Then we could do a few different things:

  1. actually write an ai/record the input of one of us playing the level to solve that bit of the level
  2. simply call functions on the player character with gravity and collision disabled so that it just floats along the level ignoring collision and falling, and clock.schedule the pickup of coins, use of actions, collision with enemies, and loss of lives

the goal is to have a standard play-through in which we test all the important things that can happen to see what bits are actually having problems and be able to compare changes in a standardized way

if writing a method of saving the random generation is too difficult we could really just do #2 with any old randomized level and just have a clock.schedule that executes a certain amount of dashes, jumps, enemy kills, loss of life to falling/enemy, coin pickups, and so on