
-----------------------------------
Wolf_Destiny
Thu Feb 26, 2009 12:41 am

A DDR Clone, except not.
-----------------------------------
Made a DDR style game, except it's not put to music, and the "steps" all move at different speeds. Run it and you'll see what I mean. It gets difficult pretty quickly, but starts off easy. Essentially you just press each arrow key when they are between the two green lines, and you get more points if it's closer to the center (indicated by a blue line.)
Anyways, here's the code if anyone wants to try it.
procedure fade
View.Set ("offscreenonly,nobuttonbar,title:TGiC - By: Wolf_Destiny,graphics:400,400,position:center,center")

var font : int := Font.New ("Courier New:12")
var line1 : string := "   T.G.i.C.   "
var line2 : string := "By: Wolf_Destiny"
var line3 : string := "  }-Remake-{  "
var line4 : string := " V:0.0.4:Alpha "
for a : 1..length (line1)
Font.Draw (line1 (1..a),120,round (maxy/2),font,black)
View.Update
delay (100)
end for
for a : 1..length (line2)
Font.Draw (line2 (1..a),120,round (maxy/2)-20,font,black)
View.Update
delay (100)
end for
for a : 1..length (line3)
Font.Draw (line3 (1..a),120,round (maxy/2)-40,font,black)
View.Update
delay (100)
end for
for a : 1..length (line4)
Font.Draw (line4 (1..a),120,round (maxy/2)-80,font,black)
View.Update
delay (100)
end for
delay (1000)
for decreasing a : 31..16
drawfillbox (0,0,maxx,maxy,a)
Font.Draw (line1,120,round (maxy/2),font,black)
Font.Draw (line2,120,round (maxy/2)-20,font,black)
Font.Draw (line3,120,round (maxy/2)-40,font,black)
View.Update
delay (100)
end for
line1 := "  Get Ready!  "
for a : 1..length (line1)
Font.Draw (line1 (1..a),120,round (maxy/2),font,white)
View.Update
delay (100)
end for
delay (1000)
line2 := "3...2...1..."
for a : 1..length (line2)
Font.Draw (line2 (1..a),120,round (maxy/2)-20,font,white)
View.Update
delay (250)
end for
end fade
fade

View.Set ("offscreenonly,nobuttonbar,title:TGiC - By: Wolf_Destiny,graphics:400,max,position:center,center")

var Exit : boolean := false

procedure End_Game
Exit := true
end End_Game

var Upper : int := 300
var Lower : int := 100

var chars : array char of boolean
var Score : real := 0
var arrows : int := 25
var wall : int := 50
var size : int := 25
var minincr : int := 5
var maxincr : int := 25

var p : array 1.. arrows of record
_hit : boolean
_x : int
_y : real
_yvel : real
_dir : int
end record

procedure create (i : int, New : boolean)
p (i)._hit := false
p (i)._x := round (Rand.Int (wall,maxx-wall-size)/size)
p (i)._y := maxy+Rand.Int (100,1000)
if not New then
p (i)._yvel := p (i)._yvel + Rand.Int (minincr,maxincr)/100
else
p (i)._yvel := Rand.Int (1,5)/10
end if
p (i)._dir := Rand.Int (1,4)
end create

for a : 1..arrows
create (a,true)
end for

procedure draw_arrow (i : int, highlight : boolean)
drawfillbox (p (i)._x*size-size,round (p (i)._y),
    p (i)._x*size-1,round (p (i)._y)+size,p (i)._dir)
var ac : int := p (i)._dir + 8
if highlight then
ac := 0
end if
if p (i)._dir = 1 or p (i)._dir = 3 then
Draw.ThickLine (round (p (i)._x*size - size/2),round (p (i)._y + 4),
    round (p (i)._x*size - size/2),round (p (i)._y + size - 4), 3, ac)
else
Draw.ThickLine (round (p (i)._x*size - size + 4),round (p (i)._y + size/2),
    round (p (i)._x * size - 4),round (p (i)._y + size/2),3,ac)
end if
case p(i)._dir of
label 1:
Draw.ThickLine (round (p (i)._x*size - size+4),round (p (i)._y + size/2),
    round (p (i)._x*size - size/2),round (p (i)._y + size - 4), 3, ac)
Draw.ThickLine (round (p (i)._x*size - 4),round (p (i)._y + size/2),
    round (p (i)._x*size - size/2),round (p (i)._y + size - 4), 3, ac)
label 2:
Draw.ThickLine (round (p (i)._x*size - size/2),round (p (i)._y + size-4),
    round (p (i)._x * size - size + 4),round (p (i)._y + size/2),3,ac)
Draw.ThickLine (round (p (i)._x*size - size/2),round (p (i)._y + 4),
    round (p (i)._x * size - size + 4),round (p (i)._y + size/2),3,ac)
label 3:
Draw.ThickLine (round (p (i)._x*size - size+4),round (p (i)._y + size/2),
    round (p (i)._x*size - size/2),round (p (i)._y + 4), 3, ac)
Draw.ThickLine (round (p (i)._x*size - 4),round (p (i)._y + size/2),
    round (p (i)._x*size - size/2),round (p (i)._y + 4), 3, ac)
label 4:
Draw.ThickLine (round (p (i)._x*size - size/2),round (p (i)._y + size-4),
    round (p (i)._x * size - 4),round (p (i)._y + size/2),3,ac)
Draw.ThickLine (round (p (i)._x*size - size/2),round (p (i)._y + 4),
    round (p (i)._x * size - 4),round (p (i)._y + size/2),3,ac)
label :
end case
end draw_arrow

var Reset : array 1..4 of boolean := init (true,true,true,true,)
var Key_Hit : array 1..4 of boolean := init (false,false,false,false,)
var Keys : array 1..4 of char := init (
KEY_UP_ARROW,KEY_LEFT_ARROW,KEY_DOWN_ARROW,KEY_RIGHT_ARROW,)

procedure all_keys
for a : 1..4
exit when Exit
if ~chars (Keys (a)) then
Reset (a) := true
Key_Hit (a) := false
end if
exit when Exit
end for
end all_keys

procedure check_keys (i : int)
for a : 1..4
exit when Exit
if chars (Keys (a)) and Reset (a) and p (i)._dir = a then
Key_Hit (a) := true
Reset (a) := false
p (i)._hit := true
exit
end if
exit when Exit
end for
end check_keys

procedure varify
for a : 1..4
exit when Exit
if chars (Keys (a)) and ~Key_Hit (a) then
End_Game
end if
exit when Exit
end for
end varify

procedure score (y : real)
Score += (((Upper - Lower)/2)-abs(((Upper+Lower)/2)-y))*2
end score

var Lowest : array 1..4 of record
_y : real
_i : int
end record
Lowest (1)._y := 9999
Lowest (2)._y := 9999
Lowest (3)._y := 9999
Lowest (4)._y := 9999

procedure move_arrow (i : int)
if p (i)._hit then
score (p (i)._y + size/2)
create (i,false)
else
p (i)._y -= p (i)._yvel
if p (i)._y < -size-5 then
create (i,false)
End_Game
elsif p (i)._y + size >= Lower and p (i)._y 