'Tetris 64 Ver 0.9 (start date 10/3/18-13.27)
'v0.9: (current build on 10/13/2018-13:25)
'add 'no sound' option
'add level selection to menu A to game value
'add B-Type menu
'small rocket ending done
'med rocket ending done
'Large rocket ending done
'Shuttle ending done
'High Score screen Atype done
'high score screen Btype done
'Fix rotational collisions
'divorced Narika from code
'B-Type game functional
' found new bug with rotational collisions
BGM
AS _BYTE 'Back Gound music 1,2,3 BGMVol
AS _BYTE 'Back Gound Music Volume SFXVol
AS _BYTE 'Sound effects Volume Height
AS _BYTE 'line height B-type game HScore1
AS LONG 'Highest Score HScore1B
AS LONG 'Highest Score B-type HScore2B
AS LONG 'Higher Score B-type HScore3B
AS LONG 'High Score B-type HName1B
AS STRING * 6 'High score name B-Type
Icount
AS INTEGER ' Number of I blocks used in current game Ocount
AS INTEGER ' Number of O blocks used in current game Zcount
AS INTEGER ' number of Z blocks used in current game Scount
AS INTEGER ' number of S blocks used in current game Jcount
AS INTEGER ' number of J blocks used in current game Lcount
AS INTEGER ' number of L blocks used in current game Tcount
AS INTEGER ' number of T blocks used in current game Score
AS LONG ' Current game score Piece
AS _BYTE ' The currently dropping piece NextP
AS _BYTE ' The next piece in the queue Lines
AS INTEGER ' The lines complete in A-Type, Lines remaining in B-type Orent
AS _BYTE ' rotational orentation of current piece PieceX
AS _BYTE ' current Piece's X location on board 1-10 PieceY
AS _BYTE ' current Piece's Y location on board 1-20 bonus
AS _BYTE ' Quick drop bonus +1 for each line while down is pressed
CONST TypeA
= 1, TypeB
= 2 CONST NoBGM
= 0, Song1
= 1, Song2
= 2, Song3
= 3, LoadIt
= -1, NoSound
= -2 CONST T
= 1, O
= 2, Z
= 3, S
= 4, J
= 5, L
= 6, I
= 7 CONST AdjX%
= -8, BACK
= -2, QUIT
= -3
StartData
LoadGameStuff NoSound ' LoadIt
BoardSetup
MenuID%% = 0
StartData
IF MenuID%%
= -1 THEN TitleScreen
IF MenuID%%
= 1 AND G.Mode
= TypeA
THEN MenuTwoA
IF MenuID%%
= 1 AND G.Mode
= TypeB
THEN MenuTwoB
'dumpboard 'debuging line
'------------------------------------------------------------------
_TITLE "Tetris64 V.9 2018\Cobalt"
DisplayClickOptions
exitflag%% = ClickInteraction(x%, y%)
IF exitflag%%
= TRUE
THEN MenuID%%
= 0 'goto next menu IF exitflag%%
= BACK
THEN exitflag%%
= FALSE
'no where to go backwards to IF exitflag%%
= QUIT
THEN QuitGameFlag%%
= TRUE
'quit game
SUB LoadGameStuff
(opt%%
)
FOffset&(w%) = FOffset&(w%) + 1
'function LoadGFX(Foff&,Size&,id%%)
GET #1, FOffset&
(f%%
), dat$
FFX
(1) = _LOADFONT("temp.dat", 20, "monospace")
Splash& = LoadGFX(FOffset&(3), Size(3))
'Splash& = _LOADIMAGE("Tetris_Splash.bmp", 32)
' FFX(1) = _LOADFONT("NESFont.otf", 20, "monospace")
' IF FFX(1) THEN _FONT FFX(1)
' _DELAY .125
TitleScreen
MenuA = LoadGFX(FOffset&(4), Size(4))
MenuB = LoadGFX(FOffset&(5), Size(5))
MenuC = LoadGFX(FOffset&(6), Size(6))
EndScrnA = LoadGFX(FOffset&(7), Size(7))
EndSprtA = LoadGFX(FOffset&(8), Size(8))
FieldA = LoadGFX(FOffset&(9), Size(9))
FieldB = LoadGFX(FOffset&(10), Size(10))
HighS = LoadGFX(FOffset&(11), Size(11))
Nomes = LoadGFX(FOffset&(12), Size(12))
IF opt%%
= LoadIt
THEN 'load sounds option
G.Loaded = TRUE
exitflag%% = ClickInteraction(x%, y%)
exitflag%% = FALSE
FirstRun%% = TRUE
DisplayClickOptions
old%% = G.BGM
G.Mode = TypeA
G.Mode = TypeB
G.BGM = Song1
songchange%% = TRUE
G.BGM = Song2
songchange%% = TRUE
G.BGM = Song3
songchange%% = TRUE
G.BGM = NoBGM
songchange%% = TRUE
G.BGMVol = ((x% - 37) / 128) * 100
volchange%% = TRUE
G.SFXVol = ((x% - 37) / 128) * 100
FXvolchange%% = TRUE
exitflag%% = ClickInteraction(x%, y%)
old%% = G.BGM
songchange%% = FALSE
volchange%% = TRUE
songchange%% = FALSE
_SNDVOL BGM
(G.BGM
), (G.BGMVol
/ 100) volchange%% = FALSE
_SNDPLAY SFX
(0) 'plays a test sound effect FXvolchange%% = FALSE
IF exitflag%%
<> BACK
AND exitflag%%
<> QUIT
THEN IF exitflag%%
= TRUE
THEN MenuID%%
= 1 'go to next menu IF exitflag%%
= BACK
THEN MenuID%%
= -1 'go back to title screen IF exitflag%%
= QUIT
THEN QuitGameFlag%%
= TRUE
'quit game
DisplayClickOptions
ShowHighScoreA
IF y%
> 155 AND y%
< 188 THEN ll%
= 0: yy%
= 155: lvl%%
= 0 IF y%
> 188 AND y%
< 221 THEN ll%
= 5: yy%
= 189: lvl%%
= 5 ll% = ll% + 0: xx% = 109: lvl%% = lvl%% + 0
ll% = ll% + 1: xx% = 141: lvl%% = lvl%% + 1
ll% = ll% + 2: xx% = 173: lvl%% = lvl%% + 2
ll% = ll% + 3: xx% = 204: lvl%% = lvl%% + 3
ll% = ll% + 4: xx% = 237: lvl%% = lvl%% + 4
exitflag%% = ClickInteraction(x%, y%)
G.Level = lvl%%
IF exitflag%%
= TRUE
THEN MenuID%%
= 2 'start game IF exitflag%%
= BACK
THEN MenuID%%
= 0 'go back to menu one IF exitflag%%
= QUIT
THEN QuitGameFlag%%
= TRUE
'quit game
DisplayClickOptions
ShowHighScoreB
IF y%
> 155 AND y%
< 188 THEN yy%
= 155: lvl%%
= 0 IF y%
> 188 AND y%
< 221 THEN yy%
= 189: lvl%%
= 5 xx% = 109: lvl%% = lvl%% + 0
xx% = 141: lvl%% = lvl%% + 1
xx% = 173: lvl%% = lvl%% + 2
xx% = 204: lvl%% = lvl%% + 3
xx% = 237: lvl%% = lvl%% + 4
IF y%
> 155 AND y%
< 188 THEN hyy%
= 155: hlvl%%
= 0 IF y%
> 188 AND y%
< 221 THEN hyy%
= 189: hlvl%%
= 3 hxx% = 317: hlvl%% = hlvl%% + 0
hxx% = 349: hlvl%% = hlvl%% + 1
hxx% = 381: hlvl%% = hlvl%% + 2
exitflag%% = ClickInteraction(x%, y%)
G.Level = lvl%%
G.Height = hlvl%%
P.Lines = 25
IF exitflag%%
= TRUE
THEN MenuID%%
= 2 'start game IF exitflag%%
= BACK
THEN MenuID%%
= 0 ' go back to menu one IF exitflag%%
= QUIT
THEN QuitGameFlag%%
= TRUE
'quit game
'display the next peice in queue
'display peice centered in NEXT window(420)
'first clear next window
IF G.Level
< 10 THEN Yshift~%%
= 16 * G.Level
ELSE Yshift~%%
= 16 * 9 _PUTIMAGE (420 - 24, 212 + 16), Nomes
, _DISPLAY, (32, Yshift~%%
)-(45, Yshift~%%
+ 13) _PUTIMAGE (420 - 24, 212 + 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (420 - 24, 212 + 32), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (420 - 24, 212 + 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (420 - 24, 212 + 32), Nomes
, _DISPLAY, (31, Yshift~%%
)-(45, Yshift~%%
+ 13)
px% = P.PieceX * 16 + 197 + AdjX%
py% = P.PieceY * 16 + 85 - 16
IF G.Level
< 10 THEN Yshift~%%
= 16 * G.Level
ELSE Yshift~%%
= 16 * 9 _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (32, Yshift~%%
)-(45, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 32), Nomes
, _DISPLAY, (32, Yshift~%%
)-(45, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (32, Yshift~%%
)-(45, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 32), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 16), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) _PUTIMAGE (px%
- 24, py%
+ 32), Nomes
, _DISPLAY, (16, Yshift~%%
)-(29, Yshift~%%
+ 13) CASE 1 TO 4 'normal-no rotation change _PUTIMAGE (px%
- 24, py%
+ 32), Nomes
, _DISPLAY, (31, Yshift~%%
)-(45, Yshift~%%
+ 13)
P.PieceY = P.PieceY + 1 'move Tetranome down
IF ButtonHeld%%
THEN P.bonus
= P.bonus
+ 1 'if player is pressing down button then add to bonus IF CollisionDown
THEN LandPiece
'check to see if the peice is landed
result%% = FALSE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 3) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 20 THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF P.PieceY
+ 1 = 21 THEN result%%
= TRUE
CollisionDown = result%%
Board(P.PieceX + 0, P.PieceY) = 0
Board(P.PieceX - 1, P.PieceY) = 0
Board(P.PieceX + 1, P.PieceY) = 0
Board(P.PieceX + 0, P.PieceY + 1) = 0
Board(P.PieceX + 0, P.PieceY - 1) = 0
Board(P.PieceX - 1, P.PieceY) = 0
Board(P.PieceX + 0, P.PieceY + 1) = 0
Board(P.PieceX - 1, P.PieceY) = 0
Board(P.PieceX + 1, P.PieceY) = 0
Board(P.PieceX + 0, P.PieceY - 1) = 0
Board(P.PieceX + 0, P.PieceY - 1) = 0
Board(P.PieceX + 1, P.PieceY) = 0
Board(P.PieceX + 0, P.PieceY + 1) = 0
Board(P.PieceX + 0, P.PieceY) = 2
Board(P.PieceX - 1, P.PieceY) = 2
Board(P.PieceX + 1, P.PieceY) = 2
Board(P.PieceX + 1, P.PieceY + 1) = 2
Board(P.PieceX - 0, P.PieceY - 1) = 2
Board(P.PieceX + 0, P.PieceY + 1) = 2
Board(P.PieceX - 1, P.PieceY + 1) = 2
Board(P.PieceX - 1, P.PieceY) = 2
Board(P.PieceX + 1, P.PieceY) = 2
Board(P.PieceX - 1, P.PieceY - 1) = 2
Board(P.PieceX - 0, P.PieceY - 1) = 2
Board(P.PieceX + 0, P.PieceY + 1) = 2
Board(P.PieceX + 1, P.PieceY - 1) = 2
Board(P.PieceX + 0, P.PieceY) = 1
Board(P.PieceX - 1, P.PieceY) = 1
Board(P.PieceX + 1, P.PieceY) = 1
Board(P.PieceX - 1, P.PieceY + 1) = 1
Board(P.PieceX - 0, P.PieceY - 1) = 1
Board(P.PieceX + 0, P.PieceY + 1) = 1
Board(P.PieceX - 1, P.PieceY - 1) = 1
Board(P.PieceX - 1, P.PieceY) = 1
Board(P.PieceX + 1, P.PieceY) = 1
Board(P.PieceX + 1, P.PieceY - 1) = 1
Board(P.PieceX - 0, P.PieceY - 1) = 1
Board(P.PieceX + 0, P.PieceY + 1) = 1
Board(P.PieceX + 1, P.PieceY + 1) = 1
Board(P.PieceX + 0, P.PieceY) = 1
Board(P.PieceX - 1, P.PieceY) = 1
Board(P.PieceX + 0, P.PieceY + 1) = 1
Board(P.PieceX + 1, P.PieceY + 1) = 1
Board(P.PieceX - 0, P.PieceY - 1) = 1
Board(P.PieceX - 1, P.PieceY + 0) = 1
Board(P.PieceX - 1, P.PieceY + 1) = 1
Board(P.PieceX + 0, P.PieceY) = 2
Board(P.PieceX + 1, P.PieceY) = 2
Board(P.PieceX + 0, P.PieceY + 1) = 2
Board(P.PieceX - 1, P.PieceY + 1) = 2
Board(P.PieceX - 0, P.PieceY - 1) = 2
Board(P.PieceX + 1, P.PieceY + 0) = 2
Board(P.PieceX + 1, P.PieceY + 1) = 2
Board(P.PieceX + 0, P.PieceY) = 0
Board(P.PieceX - 1, P.PieceY) = 0
Board(P.PieceX + 1, P.PieceY + 0) = 0
Board(P.PieceX + 2, P.PieceY + 0) = 0
Board(P.PieceX - 0, P.PieceY - 1) = 0
Board(P.PieceX + 0, P.PieceY + 1) = 0
Board(P.PieceX + 0, P.PieceY + 2) = 0
Board(P.PieceX + 0, P.PieceY) = 0
Board(P.PieceX - 1, P.PieceY) = 0
Board(P.PieceX - 0, P.PieceY + 1) = 0
Board(P.PieceX - 1, P.PieceY + 1) = 0
CheckLines
IF ButtonHeld%%
THEN P.Score
= P.Score
+ (P.bonus
* (G.Level
+ 1)): LandedNew%%
= TRUE
P.bonus = 0
IF G.Level
< 10 THEN Yshift~%%
= 16 * G.Level
ELSE Yshift~%%
= 16 * 9 IF Board
(x%
+ 1, y%
+ 1) <> -1 THEN _PUTIMAGE (197 + x%
* 16, 85 + y%
* 16), Nomes
, _DISPLAY, (0 + 16 * Board
(x%
+ 1, y%
+ 1), Yshift~%%
)-(15 + 16 * Board
(x%
+ 1, y%
+ 1), 15 + Yshift~%%
) LINE (197 + x%
* 16, 85 + y%
* 16)-(197 + 15 + x%
* 16, 85 + 15 + y%
* 16), _RGB32(0, 0, 0), BF
Board(x%, y%) = TRUE
LandPiece
DIM Lines%
(4) 'can fill up to 4 lines at once for a TETRIS ip%% = 1
'find solid lines
solid%% = TRUE 'assume line is solid at start
IF Board
(x%%
, y%%
) = TRUE
THEN solid%%
= FALSE
'change to false if hole found IF solid%%
THEN Lines%
(ip%%
) = y%%: ip%%
= ip%%
+ 1 ip%% = ip%% - 1
IF G.Mode
= TypeA
THEN P.Lines
= P.Lines
+ ip%%
IF G.Mode
= TypeB
THEN P.Lines
= P.Lines
- ip%%
IF P.Lines
< 0 THEN P.Lines
= 0 'remove solid lines
Board(6 - x%, Lines%(y%)) = -1
Board(5 + x%, Lines%(y%)) = -1
DrawBoard
'give player points for lines completed
P.Score = P.Score + (40 * (G.Level + 1))
P.Score = P.Score + (100 * (G.Level + 1))
P.Score = P.Score + (300 * (G.Level + 1))
P.Score = P.Score + (1200 * (G.Level + 1))
'TETRIS bonus
IF ip%%
= 4 THEN P.Score
= P.Score
+ (100 * (ip%%
* (G.Level
+ 1))) 'drop any lines down to fill in gaps
Board(x%%, y%%) = Board(x%%, y%% - 1)
FOR x%%
= 1 TO 10 'reset top line Board(x%%, y%% + 1) = TRUE
DrawBoard
IF G.Level
< 10 THEN G.Level
= G.Level
+ 1
IF G.Mode
= TypeB
AND P.Lines
= 0 THEN GameOver
result%% = FALSE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 3) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
CollisionLeft = result%%
result%% = FALSE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 2, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 3, P.PieceY
) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
- 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 3) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
CollisionRight = result%%
DIM v$
(11) 'value strings
IF Board
(5, 1) <> TRUE
THEN GameOver
P.PieceY = 0
P.PieceX = 5
P.Orent = 1
P.Piece = P.NextP
P.Tcount = P.Tcount + 1
P.Jcount = P.Jcount + 1
P.Lcount = P.Lcount + 1
P.Zcount = P.Zcount + 1
P.Scount = P.Scount + 1
P.Ocount = P.Ocount + 1
P.Icount = P.Icount + 1
StatusUpdate
DisplayNextPiece
result%% = FALSE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 0, P.PieceY
+ 0) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 2) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 0, P.PieceY
+ 3) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
- 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF Board
(P.PieceX
+ 1, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
IF P.PieceX
+ 2 < 12 THEN IF Board
(P.PieceX
+ 2, P.PieceY
+ 1) > TRUE
THEN result%%
= TRUE
CollisionRotate = result%%
MenuID%% = -1 'return to title screen
G.GameOverFlag = TRUE
Board(x%, y%) = 3
DrawBoard
IF P.Score
> 30000 THEN EndScreen
IF P.Score
> G.HScore3
THEN HighScoreScreen
IF P.Score
> G.HScore3B
THEN HighScoreScreen
result%% = TRUE
result%% = BACK
result%% = QUIT
ClickInteraction = result%%
y% = y% + (16 * (w% / 100))
_PUTIMAGE (168, 388 - y%
), EndScrnA
, _DISPLAY, (168 + 59, 373 + 10 - y%
)-(184 + 59, 388 + 10 - y%
) _PUTIMAGE (168, 388 - y%
), EndScrnA
, _DISPLAY, (168 + 59, 389 + 10 - y%
)-(184 + 59, 405 + 10 - y%
) y% = y% + (16 * (w% / 100))
_PUTIMAGE (168, 356 - y%
), EndScrnA
, _DISPLAY, (168 + 59, 357 + 10 - y%
)-(184 + 59, 389 + 10 - y%
) _PUTIMAGE (168, 388 - y%
), EndScrnA
, _DISPLAY, (168 + 59, 389 + 10 - y%
)-(184 + 59, 405 + 10 - y%
) y% = y% + (16 * (w% / 100))
_PUTIMAGE (160, 325 - y%
), EndScrnA
, _DISPLAY, (160 + 59, 325 + 10 - y%
)-(192 + 59, 389 + 10 - y%
) _PUTIMAGE (160, 388 - y%
), EndScrnA
, _DISPLAY, (160 + 59, 389 + 10 - y%
)-(192 + 59, 405 + 10 - y%
) y% = y% + (16 * (w% / 100))
_PUTIMAGE (160, 278 - y%
), EndScrnA
, _DISPLAY, (160 + 59, 279 + 10 - y%
)-(212 + 59, 389 + 10 - y%
) _PUTIMAGE (160, 388 - y%
), EndScrnA
, _DISPLAY, (160 + 59, 389 + 10 - y%
)-(212 + 59, 421 + 10 - y%
)
ShowHighScoreA
G.HScore1 = P.Score: G.Hlevel1 = G.Level
lv%% = 1: ltr%% = 65: G.HName1 = " "
names(1) = "A"
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName1 = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 326)-(166 + ((lv%%
- 1) * 16), 328), _RGB32(212, 64, 48), BF
G.HScore2 = P.Score: G.Hlevel2 = G.Level
lv%% = 1: ltr%% = 65: G.HName2 = " "
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName2 = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 358)-(166 + ((lv%%
- 1) * 16), 360), _RGB32(212, 64, 48), BF
G.HScore3 = P.Score: G.Hlevel3 = G.Level
lv%% = 1: ltr%% = 65: G.HName3 = " "
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName3 = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 390)-(166 + ((lv%%
- 1) * 16), 392), _RGB32(212, 64, 48), BF
ShowHighScoreB
G.HScore1B = P.Score: G.Hlevel1B = G.Level
lv%% = 1: ltr%% = 65: G.HName1B = " "
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName1B = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 326)-(166 + ((lv%%
- 1) * 16), 328), _RGB32(212, 64, 48), BF
G.HScore2B = P.Score: G.Hlevel2B = G.Level
lv%% = 1: ltr%% = 65: G.HName2B = " "
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName2B = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 358)-(166 + ((lv%%
- 1) * 16), 360), _RGB32(212, 64, 48), BF
G.HScore3B = P.Score: G.Hlevel3B = G.Level
lv%% = 1: ltr%% = 65: G.HName3B = " "
names(w%%) = " "
IF lv%%
> 1 THEN lv%%
= lv%%
- 1 IF lv%%
< 6 THEN lv%%
= lv%%
+ 1 ltr%% = ltr%% + 1
ltr%% = ltr%% - 1
exitflag%% = TRUE
names
(lv%%
) = CHR$(ltr%%
) G.HName3B = names(1) + names(2) + names(3) + names(4) + names(5) + names(6)
LINE (150 + ((lv%%
- 1) * 16), 390)-(166 + ((lv%%
- 1) * 16), 392), _RGB32(212, 64, 48), BF
IF P.PieceX
= 1 THEN P.PieceX
= 2 IF P.PieceX
= 0 THEN P.PieceX
= 1 IF P.PieceX
= 1 THEN P.PieceX
= 2 IF P.PieceX
= 1 THEN P.PieceX
= 2 IF P.PieceX
= 0 THEN P.PieceX
= 1 IF P.PieceX
= 1 THEN P.PieceX
= 2 IF P.PieceX
= 0 THEN P.PieceX
= 1 IF P.PieceX
= 1 THEN P.PieceX
= 2
IF P.PieceX
= 10 THEN P.PieceX
= 9 IF P.PieceX
= 11 THEN P.PieceX
= 10 IF P.PieceX
= 10 THEN P.PieceX
= 9 IF P.PieceX
= 11 THEN P.PieceX
= 10 IF P.PieceX
= 10 THEN P.PieceX
= 9 IF P.PieceX
= 10 THEN P.PieceX
= 9 IF P.PieceX
= 11 THEN P.PieceX
= 10 IF P.PieceX
= 11 THEN P.PieceX
= 10 IF P.PieceX
= 9 THEN P.PieceX
= 8
G.BGMVol = 100
G.SFXVol = 100
G.Mode = TypeA
G.BGM = Song1
G.HScore1 = 15000
G.HScore2 = 10000
G.HScore3 = 5000
G.Hlevel1 = 10
G.Hlevel2 = 5
G.Hlevel3 = 1
G.HName1 = "Narika"
G.HName2 = "Cobalt"
G.HName3 = "Ninten"
G.HScore1B = 5000
G.HScore2B = 3000
G.HScore3B = 1000
G.Hlevel1B = 10
G.Hlevel2B = 5
G.Hlevel3B = 1
G.HName1B = "Nobody"
G.HName2B = "anybdy"
G.HName3B = "losers"
G.Level = 0
P.Score = 0
G.GameOverFlag = FALSE
G.Level = 0
P.Score = 0
P.Lines = 0
BoardSetup
FOR y%%
= 20 TO (20 - (G.Height
* 3)) + 1 STEP -1 garbage%%
= INT(RND * 100) + 1
NewPiece
PlaceTetraNome
'197,85
'Btype height * 3 lines
P.PieceX = P.PieceX - 1
MoveLeft
P.PieceX = P.PieceX + 1
MoveRight
IF ButtonHeld%%
= FALSE
THEN 'if player holds the down arrow switch to faster timer ButtonHeld%% = TRUE
'rotational point is second block, top row if app.
P.Orent = P.Orent + 1
IF P.Orent
= 5 THEN P.Orent
= 1 'if piece is to close to edge to rotate then bump it out 1
IF P.PieceX
= 1 AND P.Orent
<> 4 THEN P.PieceX
= 2 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 1 AND (P.Orent
<> 1 OR P.Orent
<> 3) THEN P.PieceX
= 2 IF P.PieceX
= 10 AND (P.Orent
<> 1 OR P.Orent
<> 3) THEN P.PieceX
= 8 exitflag%% = TRUE
QuitGameFlag%% = TRUE
ButtonHeld%% = FALSE
P.bonus = 0
LINE (197, 85)-(197 + 159, 85 + 319), _RGB32(0, 0, 0), BF
DrawBoard
PlaceTetraNome
IF G.GameOverFlag
THEN exitflag%%
= TRUE
BTypeHeight
NewPiece
PlaceTetraNome
'Btype height * 3 lines
P.PieceX = P.PieceX - 1
MoveLeft
P.PieceX = P.PieceX + 1
MoveRight
IF ButtonHeld%%
= FALSE
THEN 'if player holds the down arrow switch to faster timer ButtonHeld%% = TRUE
'rotational point is second block, top row if app.
P.Orent = P.Orent + 1
IF P.Orent
= 5 THEN P.Orent
= 1 'if piece is to close to edge to rotate then bump it out 1
IF P.PieceX
= 1 AND P.Orent
<> 4 THEN P.PieceX
= 2 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 10 AND P.Orent
<> 2 THEN P.PieceX
= 9 IF P.PieceX
= 1 AND (P.Orent
<> 1 OR P.Orent
<> 3) THEN P.PieceX
= 2 IF P.PieceX
= 10 AND (P.Orent
<> 1 OR P.Orent
<> 3) THEN P.PieceX
= 8 exitflag%% = TRUE
QuitGameFlag%% = TRUE
ButtonHeld%% = FALSE
P.bonus = 0
LINE (197, 85)-(197 + 159, 85 + 319), _RGB32(0, 0, 0), BF
DrawBoard
PlaceTetraNome
IF G.GameOverFlag
THEN exitflag%%
= TRUE