import weapon in "item.tu"
var P1Posx, P1Fistx, P1Fisty, P1Headx, P1Heady, P2Posx, P2Fistx, P2Fisty, P2Headx,
P2Heady, Player1Health, Player2Health, P1eye, P2eye,P1body,P2body,Thick1,Thick2,p1b,p2b : int
%Music.PlayFileReturn ("Theme.MID")
%Player 1 Parameters
P1Posx := 50
P1Fistx := P1Posx + 35
P1Fisty := 40
P1Headx := P1Posx
P1Heady := 60
Player1Health := 100000
P1body:=30
Thick1:=20
p1b:=P1Fistx
%Player 2 Parameters
P2Posx := 585
P2Fistx := P2Posx- 35
P2Fisty := 40
P2Headx := P2Posx
P2Heady := 60
Player2Health := 100000
p2b:=P2Fistx
P2body:=30
Thick2:=20
View.Set ("offscreenonly")
loop
put "Player 1 Health ", Player1Health, " Player 2 Health ", Player2Health
%Player 1 Controls
var chars : array char of boolean
Input.KeyDown (chars)
if chars ('x') then
P1Posx := P1Posx + 5
P1Fistx := P1Fistx + 5
elsif chars ('z') then
P1Posx := P1Posx - 5
P1Fistx := P1Fistx - 5
elsif chars (KEY_ALT) then
P1Fisty := P1Fisty - 20
P1body:=P1body-10
Thick1:=Thick1-10
P1Heady:=P1Heady-25
elsif chars (KEY_SHIFT) then
end if
%Player 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if chars (KEY_RIGHT_ARROW) then
P2Posx := P2Posx + 5
P2Fistx := P2Fistx + 5
elsif chars (KEY_LEFT_ARROW) then
P2Posx := P2Posx - 5
P2Fistx := P2Fistx - 5
elsif chars (KEY_DOWN_ARROW) then
P2Fisty := P2Fisty - 20
P2body:=P2body-10
Thick2:=Thick2-10
P2Heady:=P2Heady-25
elsif chars (KEY_CTRL) then
end if
if P1Posx >= 257 then
P1Posx := P1Posx - 5
P1Fistx := P1Fistx - 5
end if
if P2Posx <= 317 then
P2Posx := P2Posx + 5
P2Fistx := P2Fistx + 5
end if
%Damage Engine Player 1
if P1Posx + 10 > P2Fistx and P1Posx - 10 < P2Fistx and P2Fisty = 40 then
Player1Health := Player1Health - 15
else
Player1Health := Player1Health
end if
%Damage Engine Player 2
if P2Posx + 10 > P1Fistx and P2Posx - 10 < P1Fistx and P1Fisty = 40 then
Player2Health := Player2Health - 15
else
Player2Health := Player2Health
end if
%Player 1 Image
Draw.FillOval (P1Posx, P1body, 10, Thick1, blue)
Draw.FillOval (P1Posx, P1Heady, 10, 10, blue)
Draw.ThickLine (P1Posx, Thick1+10, P1Posx, 0, 10, blue)
Draw.ThickLine (P1Posx, P1Fisty, P1Fistx, P1Fisty, 10, blue)
weapon.handgun (P2Fistx, P2Fisty)
%Player 2 Image
Draw.FillOval (P2Posx, P2body, 10, Thick2, red)
Draw.FillOval (P2Posx, P2Heady, 10, 10, red)
Draw.ThickLine (P2Posx, Thick2+10, P2Posx, 0, 10, red)
Draw.ThickLine (P2Posx, P2Fisty, P2Fistx, P2Fisty, 10, red)
weapon.handgun2 (P1Fistx, P1Fisty)
%Player 1 Parameters
P1Fistx := P1Posx+35
P1Fisty := 40
P1Headx := P1Posx
P1Heady := 60
Thick1:=20
P1body:=30
%Player 2 Parameters
P2Fistx := P2Posx - 35
P2Fisty := 40
P2Headx := P2Posx
P2Heady := 60
P2body :=30
Thick2:=20
if Player1Health = 0 then
elsif Player2Health = 0 then
exit
end if
View.Update
delay (15)
cls
end loop
|