The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

SDL::Tutorial::Tetris -- Let's Make Tetris

CATEGORY

Tutorials

The Overall view

All games are a while loop. So we will have something like this.

The Game Loop

package Tetris;

sub run_game_fun_times
{
 while(1)
 {
  #game logic here
 }
}	

You need more code you say? Ok well, a game does two things more.

The Game Logic

Input Events

A game essentially move objects (boxes, monsters so on) in time.

Time

In SDL time is measured in ticks.

User Input
Draw Everything

--Kartik