Tetris « Game Cartoon « Flash Tutorials

Home
Flash Tutorials
1.Actionscript Programming
2.Animals
3.Animation
4.Colors
5.Design
6.Effects
7.Game Cartoon
8.Humans
9.Models
10.Nature
11.Operations
12.Shapes
Photoshop Tutorials
Maya Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
Flash Tutorials » Game Cartoon » Tetris 
if (piecetype == 0) { if (rotatedcount == 0) //If it has been rotated 0 times. { if (unitmap[xx[0] + 2][yy[0] - 1] == undefined && unitmap[xx[1] + 1][yy[1]] == undefined && unitmap[xx[2]][yy[2] + 1] == undefined && unitmap[xx[3] - 1][yy[3] + 2] == undefined) //Checks if the space it will rotate to is available { //Changes the coordinates of the piece in the xx and yy arrays that hold the position of the piece. xx[0] = xx[0] + 2; yy[0] = yy[0] - 1; xx[1] = xx[1] + 1; yy[2] = yy[2] + 1; xx[3] = xx[3] - 1; yy[3] = yy[3] + 2; rotatedcount++; //Adds one to the rotatedcount variable. } } else { if (unitmap[xx[0] - 2][yy[0] + 1] == undefined && unitmap[xx[1] - 1][yy[1]] == undefined && unitmap[xx[2]][yy[2] - 1] == undefined && unitmap[xx[3] + 1][yy[3] - 2] == undefined && currentpiece._x != 0 && currentpiece._x != 20 && currentpiece._x != 180) { xx[0] = xx[0] - 2; yy[0] = yy[0] + 1; xx[1] = xx[1] - 1; yy[2] = yy[2] - 1; xx[3] = xx[3] + 1; yy[3] = yy[3] - 2; rotatedcount = 0; } } reposition(); //Repositions the piece according to how you just moved it. } else if (piecetype == 1) { if (rotatedcount == 0)...

w__w___w.___j_a_v_a___2__s._co___m_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.