User:Benpage26/Tetris

From GPWiki

Files:GUITutorial_warn.gif The Game Programming Wiki has moved! Files:GUITutorial_warn.gif

The wiki is now hosted by GameDev.NET at wiki.gamedev.net. All gpwiki.org content has been moved to the new server.

However, the GPWiki forums are still active! Come say hello.

Yeah, so based on Kidmosey's Tetris Primer I intend to make a more in-depth Java Tutorial. This isn't the best way to learn, because those of you reading will have a tendency to go into auto-pilot and not think for yourself. I encourage you to read through this tutorial in full, and not just skip through to the Source and try to run it. That will only hurt you in the long run.


This will take me a while to sort out, so this is just its draft stage at the moment.

Contents

Design stage

Know what your program does

Basic Structure

Know how it is done

Before you start any program you need to understand the basic way it will work, this is a good habit to get into, especially when you are dealing with larger projects.


Code Excerpts

Representation

  • Ontology
    • Shapes
      • Possible Shapes
      • Current Shapes on screen
    • Score
      • Current Score
      • Ways that you score
    • Physics
      • Rules of the game-world
      • Actions that are permitted etc.

Rendering

  • Paint method
  • Update method for implementing double buffering?

User Input

  • EventListener from AWT