60 likes | 344 Views
TETRIS!. Jeff Dam. Inspiration/Methods. Inspiration: pacman.m Methods: For the shapes they were created just with an array Shapes are chosen at random with a rand() function 4 different shapes with equal probability Movement is created using random walks
E N D
TETRIS! Jeff Dam
Inspiration/Methods • Inspiration: pacman.m • Methods: • For the shapes they were created just with an array • Shapes are chosen at random with a rand() function • 4 different shapes with equal probability • Movement is created using random walks • If left or right is chosen it also moves down to save time and to prevent it getting stuck. • Boundaries • Like the DLA, it checks it checks the left/right side & diagonal to see if there is a colored in box. If there is it moves straight down. • If there is something below it, it will stop and another shape is generated. • Game ends when ((maxX/2)-1: (maxX/2)+1 , maxY-4) is occupied • Color • Used colormap with JET
Run code with “Tetris” • .10 probability of moving left or right. 0.01 probability of moving left or right.