Warning
You're browsing the old v2.x documentation. This version is no longer maintained. Click here to go the v3.x documentation.
Step 2: Planning the Game
To keep it simple, let's define some restrictions against the game we're going to develop:
- There will be a single screen only.
- The game will display unmodified PETSCII characters only.
- Shapes will be displayed in different colors.
- The game will use the default memory layout provided by the XC=BASIC runtime.
- The player will be required to use joystick in port 1.
- No highscore saving.
- No sounds or music.
- No interrupts (although they are supported in XC=BASIC).
- No optimization beyond a certain point. We will optimize the code only if it's necessary for playability. In other cases we'll try to keep things simple instead.
Game rules
I think everyone knows Tetris, but it may be worth clarifying the rules because there are many different versions around, each of them slightly different. I was getting ideas from the Tetris Wiki on Fandom where I found a lot of interesting information about the game. So here are the rules:
- The playfield measures ten spaces across by twenty spaces down
- Shapes will be selected randomly. New shapes appear 4 lines above the ceiling. No entry delay will be added.
- The player can move or rotate the piece 4 times before it moves one position down.
- Pieces can only be soft dropped.
- No floor kicking or wall kicking.
- There will be 10 levels (1 to 10), gradually speeding up the gameplay. The next level comes after clearing 100 rows.
- On clearing one, two, three or four rows, the player will get 40, 100, 300 and 1200 points, respectively. This bonus will be multiplied by the current level, ie. doubled on level 2, tripled on level 3, etc…
We will start the game development with designing the screen on the next page.