Quote: "The Code is too long for a code snippet! (about 1800 lines)"
we will see...
REM Projekt: StickSuicide2 - English
REM By Valle :``2006
set display mode 1024,768,32
sync on : sync rate 60
set image colorkey 255,0,255
disable escapekey
gosub init_menu
gosub menu
gosub main
menu:
follow = -1
xscroll = 0 : yscroll = 0
mompoint = 0
hide sprite 4
do
cls
gosub blood
if Button("Start game",512-xscroll,284-yscroll,100,30,0) = 1 and follow = -1 then xscroll = 0 : yscroll = -100 : follow = 0
if follow = 0
if follow_path(0,512,284,1) = 1
show_path(0,512,284)
if button("Mode : "+modus(mode),1300-xscroll,-50-yscroll,100,30,9) = 1 and timer()-time > 200
time = timer()
if mode = 1 then mode = 0 else mode = 1
endif
if mode = 1
button2("Frags to win : "+str$(fragaim),1300-xscroll,50-yscroll,100,30) : line 1300-xscroll,180-yscroll,1300-xscroll,220-yscroll
if button("-",1100-xscroll,50-yscroll,30,30,10) = 1 and fragaim > 10 and timer()-time > 50 then dec fragaim,1 : time = timer()
if button("+",1500-xscroll,50-yscroll,30,30,11) = 1 and fragaim < 300 and timer()-time > 50 then inc fragaim,1 : time = timer()
endif
if mode = 0
button2("Wintime : "+str$(bagaim),1300-xscroll,50-yscroll,100,30) : line 1300-xscroll,180-yscroll,1300-xscroll,220-yscroll
if button("-",1100-xscroll,50-yscroll,30,30,10) = 1 and bagaim > 200 and timer()-time > 50 then dec bagaim,10 : time = timer()
if button("+",1500-xscroll,50-yscroll,30,30,11) = 1 and bagaim < 10000 and timer()-time > 50 then inc bagaim,10 : time = timer()
endif
button2("Level : "+str$(sel_level),1300-xscroll,150-yscroll,100,30) : line 1300-xscroll,180-yscroll,1300-xscroll,220-yscroll
if button("-",1100-xscroll,150-yscroll,30,30,4) = 1 and sel_level > 1 and timer()-time > 200 then dec sel_level,1 : time = timer()
if button("+",1500-xscroll,150-yscroll,30,30,5) = 1 and sel_level < 3 and timer()-time > 200 then inc sel_level,1 : time = timer()
button2("Bots : "+str$(maxplayers),1300-xscroll,250-yscroll,100,30)
if button("-",1100-xscroll,250-yscroll,30,30,7) = 1 and maxplayers > 0 and timer()-time > 100 then dec maxplayers,1 : time = timer()
if button("+",1500-xscroll,250-yscroll,30,30,8) = 1 and maxplayers < 20 and timer()-time > 100 then inc maxplayers,1 : time = timer()
if button("Start",1300-xscroll,350-yscroll,100,30,6) = 1 then gosub init
if button("back",900-xscroll,0-yscroll,60,20,3) = 1 then xscroll=0 : yscroll = 0 : mompoint = 0 : follow = -1
endif
endif
if follow = 1
if follow_path(1,512,384,1) = 1
show_path(1,512,384)
line -200-xscroll,370-yscroll,-200-xscroll,330-yscroll
line -200-xscroll,430-yscroll,-200-xscroll,470-yscroll
line -200-xscroll,530-yscroll,-200-xscroll,570-yscroll
line -200-xscroll,630-yscroll,-200-xscroll,670-yscroll
if button("Shells : "+onoff(shells_on),-200-xscroll,300-yscroll,100,30,5) = 1 and timer()-time > 200
time = timer()
if shells_on = 1 then shells_on = 0 else shells_on = 1
endif
if button("Sprites : "+onoff(sprits),-200-xscroll,400-yscroll,100,30,4) = 1 and timer()-time > 200
time = timer()
if sprits = 1 then sprits = 0 else sprits = 1
endif
if button("Particles : "+onoff(particles_on),-200-xscroll,500-yscroll,100,30,6) = 1 and timer()-time > 200
time = timer()
if particles_on = 1 then particles_on = 0 else particles_on = 1
endif
if button("Blood : "+onoff(blood_on),-200-xscroll,600-yscroll,100,30,7) = 1 and timer()-time > 200
time = timer()
if blood_on = 1 then blood_on = 0 else blood_on = 1
endif
if button("Botskill : "+skill(botskill),-200-xscroll,700-yscroll,100,30,8) = 1 and timer()-time > 200
time = timer()
if botskill = 1 then botskill = 0 else botskill = 1
endif
line -400-xscroll,200-yscroll,-xscroll,200-yscroll
line -400-xscroll,230-yscroll,-xscroll,230-yscroll
line -400-xscroll,230-yscroll,-400-xscroll,180-yscroll
text -390-xscroll,180-yscroll,"Playername :"
if namefieldclicked = 0
if Entry$() <> "" then clear entry buffer
center text -200-xscroll,210-yscroll,playername
else
center text -200-xscroll,210-yscroll,playername+"_"
endif
if mousex() > -400-xscroll and mousex() < -xscroll and mousey() > 200-yscroll and mousey() < 230-yscroll
if mouseclick()=1 then namefieldclicked = 1
endif
if namefieldclicked = 1
playername = new_input(playername)
endif
if len(playername) > 40 then playername = left$(playername,40)
if returnkey()=1 and namefieldclicked = 1 then namefieldclicked = 0
if button("back",50-xscroll,150-yscroll,60,20,3)=1 then save_prefs() : xscroll=0 : yscroll = 0 : mompoint = 0 : follow = -1
endif
endif
if Button("Options",512-xscroll,384-yscroll,100,30,1) = 1 and follow = -1 then xscroll = 0 : yscroll = 0 : follow = 1
if Button("Exit",512-xscroll,484-yscroll,100,30,2) = 1 then pltime = timer()-pltime : inc stats(3),pltime : save array "stats.dat",stats(0) : end
if Button("Statistics",512-xscroll,60-yscroll,90,20,3) = 1 and follow = -1 then xscroll = 0 : yscroll = -324 : follow = 2
if follow = 2
if follow_path(2,512,60,1) = 1
show_path(2,512,60)
if stats(3) > 60000
button2("Time you played StickSuicide2 : "+str$(stats(3)/60000)+","+str$(stats(3) mod (stats(3)/6000))+" Minutes",512,54,170,30)
else
button2("Time you played StickSuicide2 : 0,0 Minutes",512,54,170,30)
endif
button2("played matches : "+str$(stats(2)),512,114,150,30)
button2("won : "+str$(stats(4)),512,164,100,20)
button2("canceled : "+str$(stats(5)),512,204,100,20)
button2("lost : "+str$(stats(2)-stats(5)-stats(4)),512,244,100,20)
button2("All frags : "+str$(stats(0)),512,294,150,30)
button2("All deaths : "+str$(stats(1)),512,354,150,30)
if button("back",900,668,60,20,3) = 1 then xscroll=0 : yscroll = 0 : mompoint = 0 : follow = -1
endif
endif
sync
loop
return
init_menu:
set text font "System"
#constant grav 0.2
#constant maxblood 1000
global blood_on as boolean
global sprits as boolean
global shells_on as boolean
global particles_on as boolean
global playername as string
global maxplayers
global slowmo as float : slowmo = 1.0
global dim bl(maxblood,4) as float
global dim b(11,1) : For t = 0 to 5 : b(t,0) = 90 : next t
global dim path(3,4,1) : global mompoint = 0
global sel_level
global fragaim = 25
global bagaim = 500
global mode as boolean
mode = 1
global pltime as integer ``----> Verbrachte Zeit in StickSuicide2 seit letztem Start
pltime = timer()
global botskill as boolean
botskill = 1
global dim stats(5) as integer :``0 = frags ; 1 = deaths ; 2 = played matches ; 3 = played time ; 4 = won matches ; 5 = canceled matches
if file exist("stats.dat")=1
load array "stats.dat",stats(0)
else
For t = 0 to 5
stats(t) = 0
next t
save array "stats.dat",stats(0)
endif
if file exist("prefs.ini") = 0
open to write 1,"prefs.ini"
write string 1,"blood = 1"
write string 1,"sprites = 1"
write string 1,"shells = 1"
write string 1,"particles = 1"
write string 1,"Botskill = 0"
write string 1,"Spielername :"
write string 1,"Spieler1"
blood_on = 1
sprits = 1
shells_on = 1
particles_on = 1
botskill = 0
playername = "Spieler1"
close file 1
else
open to read 1,"prefs.ini"
read string 1,a$
blood_on = val(last$(a$))
read string 1,a$
sprits = val(last$(a$))
read string 1,a$
shells_on = val(last$(a$))
read string 1,a$
particles_on = val(last$(a$))
read string 1,a$
botskill = val(last$(a$))
read string 1,a$
read string 1,playername
close file 1
endif
sel_level = 2
restore Pathdata
For t = 0 to 3
For i = 0 to 4
For p = 0 to 1
read path(t,i,p)
next p
next i
next t
global momblood = 0
global xscroll : global yscroll
global bloodtimer as integer
cls rgb(255,0,255)
bloodsize = 14
lock pixels
For win = 0 to 360
For l = 0 to bloodsize/2 step 2
dot bloodsize/2+cos(win)*l,bloodsize/2+sin(win)*l,rgb(128+rnd(128),0,0)
next l
next win
unlock pixels
get image 3,0,0,bloodsize,bloodsize : sprite 3,-9000,-9000,3 : offset sprite 3,bloodsize/2,bloodsize/2 : set sprite 3,0,1
cls rgb(255,0,255) : ink 0,0
line 0,0,0,20 : line 1,0,1,20
line 0,0,30,10 : line 1,1,29,10
line 0,20,30,10 : line 1,19,29,10
get image 4,0,0,30,20,1 : sprite 4,-9000,-9000,4 : offset sprite 4,5,10 : set sprite 4,0,1
cls : ink rgb(236,236,0),0 : line 1,1,9,1
get image 6,0,0,10,3,1 : sprite 6,-9000,-9000,6 : offset sprite 6,5,2 : set sprite 6,0,1
return
init:
#constant maxweapons 20 ``----> Anzahl der Waffen im Level
#constant maxshots 4000 ``----> Maximale Schüsse die gleichzeitig vorhanden sein können
#constant maxshells 200 ``----> Maximale Hülsen
#constant respawntimer 100 ``----> Zeit zum nächsten Respawn
global momshell as integer ``----> Hilfsvariable für Hülsen
#constant maxparticles 1000 ``----> Maximale Partikel
global momprt as integer ``----> Hilfsvariable für Partikeleffekte
global boxnr = 0 ``----> Anzahl der Boxen im Level
global spawns = 0 ``----> Anzahl der Spielerspawnpoints
global wspawns = 0 ``----> Anzahl der Waffenspawnpoints
global bagx as integer ``-.
global bagy as integer `` |
global bagrespawntime as integer `` |--> Koffervariablen
global bagholder as integer `` |
global bagwin as integer ``-'
global won = -1 ``----> Gibt an, ob man gewonnen oder verloren hat
global showstats as boolean ``----> Ob Stats gezeigt werden oder nicht
showstats = 1
global plslowmo as integer
plslowmo = 0
type kopf
size as integer
energy as integer
stick as boolean
x as float
y as float
vx as float
vy as float
endtype
type teil
x as float
y as float
vx as float
vy as float
l as integer
rot as float
rotspeed as float
energy as integer
stick as boolean
endtype
type guy
x as float
y as float
vx as float
vy as float
stick as boolean
bot as boolean
botdir as boolean
botwin as float
tim as integer
energy as float
wpn as integer
frame as integer
framem as boolean
direc as boolean
onfloor as boolean
onbox as integer
head as kopf
upbody as teil
downbody as teil
walkspeed as float
respawntime as integer
frags as integer
name as string
j_allowed as boolean
hit_by as integer
larm1 as teil
larm2 as teil
rarm1 as teil
rarm2 as teil
lleg1 as teil
lleg2 as teil
rleg1 as teil
rleg2 as teil
endtype
type griff
pos as integer
l as integer
rot as integer
endtype
type weapon
main as teil
griff1 as griff
griff2 as griff
griff3 as griff
griff4 as griff
griff5 as griff
sound as integer
get as boolean
typ as integer
twohanded as boolean
ammo as integer
speed as integer
bulletspeed as integer
bullets as integer
ung as integer
damage as float
laser as integer
respawntime as integer
touched as boolean
endtype
global dim pl(maxplayers) as guy
global dim wp(maxweapons) as weapon
global dim sh(maxshots,6) as float
global dim shell(maxshells,5) as float
global dim prt(maxparticles,3) as float
select sel_level
case 1 : restore Level1Data : endcase
case 2 : restore Level2Data : endcase
case 3 : restore Level3Data : endcase
endselect
read boxnr
global dim bx(boxnr,3) as integer
read spawns
global dim sp(spawns,1) as integer
read wspawns
global dim wsp(wspawns,1) as integer
For t = 0 to boxnr
For i = 0 to 3
read bx(t,i)
next i
next t
For t = 0 to spawns
For i = 0 to 1
read sp(t,i)
next i
next t
For t = 0 to wspawns
For i = 0 to 1
read wsp(t,i)
next i
next t
global momshot = 0
For t = 0 to maxweapons
weapon_respawn(t)
next t
global tim as integer
For t = 0 to maxplayers
respawn(t)
pl(t).frags = 0
if t > 0
repeat
pl(t).name = random_name()
until pl(t).name <> pl(t-1).name
else
pl(t).name = playername
endif
next t
For t = 0 to maxplayers
if len(pl(t).name) > nameslength then nameslength = len(pl(t).name)
next t
pl(0).wpn = 0 : wp(0).get = 1
For t = 1 to maxplayers
pl(t).wpn = -1 : pl(t).bot = 1 : pl(t).botdir = rnd(1)
next t
cls : ink rgb(255,255,255),0 : box 0,5,10,6 : get image 1,0,0,10,10 : sprite 1,-9000,-9000,1 : offset sprite 1,0,1 : set sprite 1,0,1
cls rgb(255,0,255) : ink 0,0
For t = 0 to 5 : circle 30,30,25+t : next t
ink 0,0 : circle 30,30,30 : circle 30,30,29 : circle 30,30,24
get image 2,0,0,61,60,0
sprite 2,-9000,-9000,2 : offset sprite 2,5,5 : set sprite 2,0,1
``cls rgb(0,128,255): get image 5,0,0,1024,768 : sprite 5,0,0,5 : set sprite 5,0,1 : set sprite alpha 5,50
paused = 0
gosub main
return
main:
bag_respawn()
if mode = 0 then show sprite 4
do
scrcolor = rnd(255)
cls 0xffffff
if paused = 0 then gosub shots
if shells_on = 1 and paused = 0 then gosub shells
gosub draw_level
if blood_on = 1 and paused = 0 then gosub blood
if particles_on = 1 and paused = 0 then gosub particles
if paused = 0 then gosub handle_physics
``Spieler zeichnen und bewegen
For t = 0 to maxplayers
stick(t)
draw_player(t)
if paused = 0 then inc pl(t).x,pl(t).vx*slowmo : inc pl(t).y,pl(t).vy*slowmo
next t
if paused = 0
gosub ragdolling
gosub control_weapons
gosub control_player
gosub control_bots
gosub winorloose
endif
gosub pause
if scancode() = 15 and timer()-stattimer > 200 and showstats = 1 then showstats = 0 : stattimer = timer()
if scancode() = 15 and timer()-stattimer > 200 and showstats = 0 then showstats = 1 : stattimer = timer()
text 0,30,"fps : "+str$(screen fps())
sync
loop
return
control_player:
if controlkey() = 1
if bla = 0 then drop_weapon(0,pl(0).direc)
bla = 1
else
bla = 0
endif
if scancode() = 45 and plslowmo > 0
if slowmo > .1 then dec slowmo,0.05
if timer()-slowmotimer > 100 then dec plslowmo : slowmotimer = timer()
else
slowmo = 1
endif
if pl(0).energy <= 8 and pl(0).energy > 0 then slowmo = .5
if scancode() = 46 then die(0,5+rnd(3))
if pl(0).energy > 0 then xscroll = pl(0).x-512 : yscroll = pl(0).y-384
if rightkey() and pl(0).energy > 0 then walk_right(0,pl(0).walkspeed) else if pl(0).vx > 0 and pl(0).energy > 0 then dec pl(0).vx,.25*slowmo
if leftkey() and pl(0).energy > 0 then walk_left(0,pl(0).walkspeed) else if pl(0).vx < 0 and pl(0).energy > 0 then inc pl(0).vx,.25*slowmo
if pl(0).vx > -.2*slowmo and pl(0).vx < .2*slowmo then pl(0).vx = 0.0
if shiftkey() then jump(0,6)
if upkey() then aim_up(0)
if downkey() then aim_down(0)
if pl(0).wpn <> -1
if spacekey() then player_shoot(0)
endif
text 0,0,"Energy : "+str$(pl(0).energy*2)+"%"
text 0,15,"Slowmotion :"
box 101,16,201,30
box 102,17,plslowmo+102,29,rgb(64,64,64),rgb(64,64,64),rgb(128,128,128),rgb(128,128,128)
return
control_bots:
For t = 0 to maxplayers
if pl(t).bot = 1 and pl(t).energy > 0.0
if pl(t).wpn <> -1
``Zielen + schießen
victim = -1
For i = 0 to maxplayers
if i <> t and pl(i).energy > 0 and pl(i).x > pl(t).x-412 and pl(i).x < pl(t).x+412 and pl(i).y > pl(t).y-300 and pl(t).y < pl(i).y+300
if botskill = 1
if (sqrt((pl(t).x-pl(i).x)^2+(pl(t).y-pl(i).y)^2) < sqrt((pl(t).x-pl(i).x)^2+(pl(t).y-pl(i).y)^2)) or victim = -1
victim = i
endif
else
victim = i
endif
zielwin# = atan_full(pl(t).x-pl(victim).x,pl(t).y-pl(victim).y)
if pl(t).direc = 0
if pl(t).botwin < zielwin# then aim_up(t) else aim_down(t)
else
if wrapped(pl(t).botwin) > wrapped(zielwin#) then aim_up(t) else aim_down(t)
endif
if pl(t).botwin < zielwin#+5.0 and pl(t).botwin > zielwin#-5.0
if pl(t).direc = 1
if pl(victim).x > pl(t).x then player_shoot(t)
else
if pl(victim).x < pl(t).x then player_shoot(t)
endif
endif
endif
next i
endif
``Bewegung
allowed = 1
hoehe = 0
if (pl(t).rleg1.energy = 0 and pl(t).lleg1.energy = 0) or pl(t).downbody.stick = 0 then allowed = 0
if pl(t).botdir = 1
if allowed = 1
walk_right(t,pl(t).walkspeed)
else
if pl(t).vx > 0 then dec pl(t).vx,.25*slowmo
if pl(t).vx < 0.5 then pl(t).vx = 0
endif
endif
if pl(t).botdir = 0
if allowed = 1
walk_left(t,pl(t).walkspeed)
else
if pl(t).vx < 0 then inc pl(t).vx,.25*slowmo
if pl(t).vx > -0.5 then pl(t).vx = 0
endif
endif
if pl(t).onbox <> -1
allowed = 0
if pl(t).botdir = 1
For i = 0 to boxnr
if bx(i,0) < bx(pl(t).onbox,2) and bx(i,0) > bx(pl(t).onbox,0) and bx(i,3) > bx(pl(t).onbox,1)-100 and bx(i,1) < bx(pl(t).onbox,1)
if abs(bx(i,0)-pl(t).x) < 100
if bx(pl(t).onbox,1)-bx(i,1) <= 170 then jump(t,6)
if bx(pl(t).onbox,1)-bx(i,1) > 170 or pl(t).j_allowed = 0 then pl(t).botdir = 0
allowed = 1
endif
endif
if bx(i,2) > bx(pl(t).onbox,2)+300 and bx(i,1) > bx(pl(t).onbox,1)-150
allowed = 1
if (bx(i,2)-bx(pl(t).onbox,2))/180 > hoehe then hoehe = (bx(i,2)-bx(pl(t).onbox,2))/180
if bx(i,1) <= bx(pl(t).onbox,1) then hoehe = 6
if hoehe > 6 then hoehe = 6
if bx(i,1)-bx(pl(t).onbox,1) > 600 then allowed = 2
endif
next i
if abs(bx(pl(t).onbox,2)-pl(t).x) < 200
if abs(bx(pl(t).onbox,2)-pl(t).x) < 20
if allowed = 1 then jump(t,hoehe)
endif
if allowed = 0 then pl(t).botdir = 0 : if pl(t).vx => 5 and abs(bx(pl(t).onbox,2)-pl(t).x) < 40 then jump(t,6)
endif
else
For i = 0 to boxnr
if bx(i,2) > bx(pl(t).onbox,0) and bx(i,2) < bx(pl(t).onbox,2) and bx(i,3) > bx(pl(t).onbox,1)-100 and bx(i,1) < bx(pl(t).onbox,1)
if pl(t).x -bx(i,2)< 100
if bx(pl(t).onbox,1)-bx(i,1) <= 170 then jump(t,6)
if bx(pl(t).onbox,1)-bx(i,1) > 170 or pl(t).j_allowed = 0 then pl(t).botdir = 1
allowed = 1
endif
endif
if bx(i,0) < bx(pl(t).onbox,0)-300 and bx(i,1) > bx(pl(t).onbox,1)-150
allowed = 1
if (bx(pl(t).onbox,0)-300-bx(i,0))/180 > hoehe then hoehe = (bx(pl(t).onbox,0)-300-bx(i,0))/180
if bx(i,1) <= bx(pl(t).onbox,1) then hoehe = 6
if hoehe > 6 then hoehe = 6
if bx(i,1)-bx(pl(t).onbox,1) > 600 then allowed = 2
endif
next i
if abs(bx(pl(t).onbox,0)-pl(t).x) < 200
if abs(bx(pl(t).onbox,0)-pl(t).x) < 20
if allowed = 1 then jump(t,hoehe)
endif
if allowed = 0 then pl(t).botdir = 1 : if pl(t).vx <= -6 and abs(bx(pl(t).onbox,0)-pl(t).x) < 30 then jump(t,6)
endif
endif
endif
``Respawn
if pl(t).y > 3000
dec pl(t).respawntime,1
respawn(t)
endif
endif
``Sterben wenn Energie <= 0
if pl(t).downbody.stick = 0 and pl(t).upbody.stick = 0 then die(t,0) :``pl(t).energy = -1000
if pl(t).energy <= 0
die(t,0)
dec pl(t).respawntime,1
if pl(t).bot = 1
if pl(t).respawntime <= 0 then respawn(t)
else
if t = 0 and pl(t).respawntime > 0 then center text 512,379,"time till respawn : "+str$(pl(t).respawntime)
center text 512,0,"You see player "+str$(viewed_player+1)
center text 512,15,"-> and <- to change player"
if rightkey() and timer()-viewtimer > 400 and maxplayers <> 0
viewtimer = timer()
repeat
inc viewed_player
if viewed_player > maxplayers then viewed_player = 1
until pl(viewed_player).energy > 0
endif
if leftkey() and timer()-viewtimer > 400 and maxplayers <> 0
viewtimer = timer()
dec viewed_player
if viewed_player < 0 then viewed_player = maxplayers
if pl(viewed_player).energy < 0 then center text 512,379,"Player is dead"
endif
if pl(t).respawntime < respawntimer-50 and viewed_player > 0 and viewed_player <= maxplayers then xscroll = pl(viewed_player).x-512 : yscroll = pl(viewed_player).y-384
if pl(t).respawntime <= 0
Center text 512,379,"Press Enter to respawn!"
if returnkey() then respawn(t)
endif
endif
endif
next t
return
winorloose:
For t = 0 to maxplayers
if mode = 0
if pl(t).frags => bagaim
if t = 0 then inc stats(4) : won = 1
if t <> 0 then won = 0
endif
endif
if mode = 1
if pl(t).frags => fragaim
if t = 0 then inc stats(4) : won = 1
if t <> 0 then won = 0
endif
endif
next t
if won <> -1
ink 0,0
do
cls 0xffffff
set text size 40
ink 0,0
if won = 1 then center text 512,369,"You have won the match!"
if won = 0 then center text 512,369,"You have lost the match!"
ink rgb(128,128,128),0 : box 830,10,970,90
set text size 12
if button("zurück",900,50,60,30,9) = 1 then position mouse 512,100 : pltime = timer()-pltime : inc stats(3),pltime : pltime = timer() : inc stats(2),1 : save array "stats.dat",stats(0) : won = -1 : gosub menu
sync
loop
endif
return
pause:
if escapekey()=1
if escpressed = 0 then paused = 1 : escpressed = 1
else
escpressed = 0
endif
if paused = 1
ink 0,0 : box 312,234,712,534
ink rgb(128,128,128),0 : box 313,235,711,533
ink 0,0 : center text 512,264,"Spiel abbrechen?"
if button("Ja",412,384,50,30,9) = 1 then position mouse 512,100 : pltime = timer()-pltime : inc stats(3),pltime : pltime = timer() : inc stats(2),1 : inc stats(5),1 : save array "stats.dat",stats(0) : gosub menu
if button("Nein",612,384,50,30,10) = 1 then paused = 0
if escapekey() = 1 and escpressed = 0 then paused = 0 : gosub menu
endif
return
draw_level:
ink 0,0
For t = 0 to boxnr
if bx(t,0) <> 0 or bx(t,2) <> 0
box bx(t,0)-xscroll,bx(t,1)-yscroll,bx(t,2)-xscroll,bx(t,3)-yscroll
endif
next t
ink rgb(230,230,230),0
For t = 0 to boxnr
if bx(t,0) <> 0 or bx(t,2) <> 0
box bx(t,0)-xscroll+2,bx(t,1)-yscroll+2,bx(t,2)-xscroll-2,bx(t,3)-yscroll-2
endif
next t
leading = 0
if showstats = 1
For t = 0 to maxplayers
if pl(t).frags > pl(leading).frags then leading = t
next t
if maxplayers <> 0
For t = 0 to maxplayers
ink 0,0 :``rgb(t*200/maxplayers,t*200/maxplayers,t*200/maxplayers),0
if t = leading then ink rgb(255,0,0),0
text 5,748-(maxplayers*15)+t*15,pl(t).name
center text pl(t).x-xscroll,pl(t).y-80-yscroll,pl(t).name
text 10+nameslength*12,748-(maxplayers*15)+t*15,": "+str$(pl(t).frags)
next t
endif
endif
if mode = 0 and paused = 0
if bagholder = -1
if bagx > xscroll and bagx < 1024+xscroll and bagy > yscroll and bagy < 768+yscroll
holderwin# = 270
sprite 4,bagx-xscroll,bagy-yscroll-85,4 : rotate sprite 4,holderwin#+180
else
holderwin# = atan_full(bagx-pl(0).x,bagy-pl(0).y)
sprite 4,512-cos(holderwin#)*400,384-sin(holderwin#)*250,4 : rotate sprite 4,holderwin#+180
endif
ink 0,0 : box bagx-30-xscroll,bagy-20-yscroll,bagx+30-xscroll,bagy+20-yscroll
line bagx-10-xscroll,bagy-20-yscroll,bagx-10-xscroll,bagy-26-yscroll : line bagx+10-xscroll,bagy-20-yscroll,bagx+10-xscroll,bagy-26-yscroll
line bagx-10-xscroll,bagy-26-yscroll,bagx+10-xscroll,bagy-26-yscroll
dec bagrespawntime : if bagrespawntime <= 0 then bag_respawn()
if bagy > 3000 then bag_respawn()
For t = 0 to maxplayers
if abs(bagx-pl(t).x) < 35 and abs(bagy-pl(t).y) < 80 and pl(t).energy > 0 then bagholder = t
next t
else
bagx = pl(bagholder).x : bagy = pl(bagholder).y
if timer()-bagtimer > 200 then inc pl(bagholder).frags,1 : bagtimer = timer()
if pl(bagholder).x > xscroll and pl(bagholder).x < 1024+xscroll and pl(bagholder).y > yscroll and pl(bagholder).y < 768+yscroll
holderwin# = 270
sprite 4,pl(bagholder).x-xscroll,pl(bagholder).y-yscroll-85,4 : rotate sprite 4,holderwin#+180
else
holderwin# = atan_full(pl(bagholder).x-pl(0).x,pl(bagholder).y-pl(0).y)
sprite 4,512-cos(holderwin#)*400,384-sin(holderwin#)*250,4 : rotate sprite 4,holderwin#+180
endif
endif
endif
return
handle_physics:
For t=0 to maxplayers
if pl(t).y > 3000 then sudden_death(t)
inc pl(t).y,pl(t).vy*slowmo : inc pl(t).vy,grav*slowmo
if pl(t).stick = 1
if pl(t).upbody.stick = 1 then height = 50 else height = 0
if height = 50 and pl(t).head.stick = 0 then height = 35
if pl(t).downbody.stick = 1 then depth = 65 else depth = 0
if depth = 65 and pl(t).lleg1.energy <= 0 and pl(t).rleg1.energy <= 0 then depth = 30
if depth = 65 and pl(t).lleg2.energy <= 0 and pl(t).rleg2.energy <= 0 then depth = 47
For i = 0 to boxnr
if bx(i,0) <> 0 or bx(i,2) <> 0
if pl(t).y+depth => bx(i,1) and pl(t).y+depth < bx(i,1)+(pl(t).vy*slowmo)+20 and pl(t).x+15 > bx(i,0) and pl(t).x-15 < bx(i,2)
if pl(t).vy > 2 then pl(t).vy = -abs(pl(t).vy)*.3 else pl(t).vy = 0
pl(t).onfloor = 1 : on = 1
pl(t).onbox = i
else
if on = 0 then pl(t).onfloor = 0 : pl(t).onbox = -1
endif
if pl(t).y > bx(i,1)-depth+5 and pl(t).y < bx(i,3)+height and pl(t).x+15 => bx(i,0) and pl(t).x+15 <= bx(i,0)+abs(pl(t).vx)+10
pl(t).x = bx(i,0)-15 : pl(t).vx = -1
if t = 0 then text 0,30,str$(i)
endif
if pl(t).y > bx(i,1)-depth+5 and pl(t).y < bx(i,3)+height and pl(t).x-15 => bx(i,2)-abs(pl(t).vx)-10 and pl(t).x-15 <= bx(i,2)
pl(t).x = bx(i,2)+15 : pl(t).vx = 1
if t = 0 then text 0,30,str$(i)
endif
if pl(t).y-height<=bx(i,3) and pl(t).y-height>bx(i,3)+(pl(t).vy*slowmo)-10 and pl(t).x+15 > bx(i,0) and pl(t).x-15 < bx(i,2)
pl(t).vy = abs(pl(t).vy)
endif
endif
next i
on = 0
endif
next t
return
blood:
ink rgb(128,0,0),0
lock pixels
for t = 0 to maxblood
if bl(t,0) <> 0 or bl(t,1) <> 0
inc bl(t,0),bl(t,2)*slowmo
inc bl(t,1),bl(t,3)*slowmo
inc bl(t,3),grav*slowmo
if sprits = 0
circle bl(t,0)-xscroll,bl(t,1)-yscroll,2
else
set sprite alpha 3,bl(t,4) : if bl(t,4) > 1 then dec bl(t,4),2
paste sprite 3,bl(t,0)-xscroll,bl(t,1)-yscroll
endif
if bl(t,1) > 790+yscroll then bl(t,1) = 0 : bl(t,0) = 0
endif
next t
unlock pixels
return
particles:
ink 0,0
lock pixels
for t = 0 to maxparticles
if prt(t,0) <> 0 or prt(t,1) <> 0
inc prt(t,0),prt(t,2)*slowmo
inc prt(t,1),prt(t,3)*slowmo
inc prt(t,3),grav*slowmo
dot prt(t,0)-xscroll,prt(t,1)-yscroll
if prt(t,1) > 790+yscroll then prt(t,1) = 0 : prt(t,0) = 0 : prt(t,2) = 0 : prt(t,3) = 0
endif
next t
unlock pixels
return
shots:
lock pixels
for t = 0 to maxshots
if sh(t,0) <> 0 or sh(t,1) <> 0
brk = 0
inc sh(t,0),sh(t,2)*slowmo
inc sh(t,1),sh(t,3)*slowmo
if sh(t,6)=0 then ink 0,0
if sh(t,6)=1 then ink rgb(255,0,0),0
if sh(t,6)=2 then ink rgb(0,0,255),0
line sh(t,0)-sh(t,2)*slowmo-xscroll,sh(t,1)-sh(t,3)*slowmo-yscroll,sh(t,0)+sh(t,2)*slowmo-xscroll,sh(t,1)+sh(t,3)*slowmo-yscroll
if sh(t,6)>0
line sh(t,0)-sh(t,2)*slowmo-xscroll,sh(t,1)-1-sh(t,3)*slowmo-yscroll,sh(t,0)+sh(t,2)*slowmo-xscroll,sh(t,1)-1+sh(t,3)*slowmo-yscroll
line sh(t,0)-sh(t,2)*slowmo-xscroll,sh(t,1)+1-sh(t,3)*slowmo-yscroll,sh(t,0)+sh(t,2)*slowmo-xscroll,sh(t,1)+1+sh(t,3)*slowmo-yscroll
endif
``For u = 0 to 10
``dot sh(t,0)-xscroll-3+rnd(6),sh(t,1)-yscroll-3+rnd(6)
``next u
if sh(t,1) > 850+yscroll or sh(t,1) < -55+yscroll or sh(t,0) < -50+xscroll or sh(t,0) > 1080+xscroll then delete_shot(t)
For p = 0 to maxplayers
vc# = sqrt((sh(t,2)*slowmo)^2+(sh(t,3)*slowmo)^2)
if PointinBox(pl(p).lleg2.x,pl(p).lleg2.y,pl(p).lleg2.x+cos(pl(p).lleg2.rot)*pl(p).lleg2.l,pl(p).lleg2.y+sin(pl(p).lleg2.rot)*pl(p).lleg2.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).lleg2.energy > sh(t,4)
dec pl(p).lleg2.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).lleg2.stick = 0 : pl(p).lleg2.rotspeed = 3 : pl(p).lleg2.vx = sh(t,2)/5 : pl(p).lleg2.vy=sh(t,3)/5 : pl(p).lleg2.energy = 0
endif
if pl(p).lleg2.energy <= 0 then pl(p).lleg1.stick = 0 : pl(p).lleg2.rotspeed = 3 : pl(p).lleg2.vx = sh(t,2)/5 : pl(p).lleg2.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).rleg2.x,pl(p).rleg2.y,pl(p).rleg2.x+cos(pl(p).rleg2.rot)*pl(p).rleg2.l,pl(p).rleg2.y+sin(pl(p).rleg2.rot)*pl(p).rleg2.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).rleg2.energy > sh(t,4)
dec pl(p).rleg2.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).rleg2.stick = 0 : pl(p).rleg2.rotspeed = 3 : pl(p).rleg2.vx = sh(t,2)/5 : pl(p).rleg2.vy=sh(t,3)/5 : pl(p).rleg2.energy = 0
endif
if pl(p).rleg2.energy <= 0 then pl(p).rleg2.stick = 0 : pl(p).rleg2.rotspeed = 3 : pl(p).rleg2.vx = sh(t,2)/5 : pl(p).rleg2.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).rleg1.x,pl(p).rleg1.y,pl(p).rleg1.x+cos(pl(p).rleg1.rot)*pl(p).rleg1.l,pl(p).rleg1.y+sin(pl(p).rleg1.rot)*pl(p).rleg1.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).rleg1.energy > sh(t,4)
dec pl(p).rleg1.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).rleg1.stick = 0 : pl(p).rleg1.rotspeed = 3 : pl(p).rleg1.vx = sh(t,2)/5 : pl(p).rleg1.vy=sh(t,3)/5 : pl(p).rleg1.energy = 0
endif
if pl(p).rleg1.energy <= 0 then pl(p).rleg1.stick = 0 : pl(p).rleg1.rotspeed = 3 : pl(p).rleg1.vx = sh(t,2)/5 : pl(p).rleg1.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).lleg1.x,pl(p).lleg1.y,pl(p).lleg1.x+cos(pl(p).lleg1.rot)*pl(p).lleg1.l,pl(p).lleg1.y+sin(pl(p).lleg1.rot)*pl(p).lleg1.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).lleg1.energy > sh(t,4)
dec pl(p).lleg1.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).lleg1.stick = 0 : pl(p).lleg1.rotspeed = 3 : pl(p).lleg1.vx = sh(t,2)/5 : pl(p).lleg1.vy=sh(t,3)/5 : pl(p).lleg1.energy = 0
endif
if pl(p).lleg1.energy <= 0 then pl(p).lleg1.stick = 0 : pl(p).lleg1.rotspeed = 3 : pl(p).lleg1.vx = sh(t,2)/5 : pl(p).lleg1.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).rarm2.x,pl(p).rarm2.y,pl(p).rarm2.x+cos(pl(p).rarm2.rot)*pl(p).rarm2.l,pl(p).rarm2.y+sin(pl(p).rarm2.rot)*pl(p).rarm2.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).rarm2.energy > sh(t,4)
dec pl(p).rarm2.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).rarm2.stick = 0 : pl(p).rarm2.rotspeed = 3 : pl(p).rarm2.vx = sh(t,2)/5 : pl(p).rarm2.vy=sh(t,3)/5 : pl(p).rarm2.energy = 0
endif
if pl(p).rarm2.energy <= 0 then pl(p).rarm2.stick = 0 : pl(p).rarm2.rotspeed = 3 : pl(p).rarm2.vx = sh(t,2)/5 : pl(p).rarm2.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).larm2.x,pl(p).larm2.y,pl(p).larm2.x+cos(pl(p).larm2.rot)*pl(p).larm2.l,pl(p).larm2.y+sin(pl(p).larm2.rot)*pl(p).larm2.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).larm2.energy > sh(t,4)
dec pl(p).larm2.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).larm2.stick = 0 : pl(p).larm2.rotspeed = 3 : pl(p).larm2.vx = sh(t,2)/5 : pl(p).larm2.vy=sh(t,3)/5 : pl(p).larm2.energy = 0
endif
if pl(p).larm2.energy <= 0 then pl(p).larm2.stick = 0 : pl(p).larm2.rotspeed = 3 : pl(p).larm2.vx = sh(t,2)/5 : pl(p).larm2.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).rarm1.x,pl(p).rarm1.y,pl(p).rarm1.x+cos(pl(p).rarm1.rot)*pl(p).rarm1.l,pl(p).rarm1.y+sin(pl(p).rarm1.rot)*pl(p).rarm1.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).rarm1.energy > sh(t,4)
dec pl(p).rarm1.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).rarm1.stick = 0 : pl(p).rarm1.rotspeed = 3 : pl(p).rarm1.vx = sh(t,2)/5 : pl(p).rarm1.vy=sh(t,3)/5 : pl(p).rarm1.energy = 0
endif
if pl(p).rarm1.energy <= 0 then pl(p).rarm1.stick = 0 : pl(p).rarm1.rotspeed = 3 : pl(p).rarm1.vx = sh(t,2)/5 : pl(p).rarm1.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).larm1.x,pl(p).larm1.y,pl(p).larm1.x+cos(pl(p).larm1.rot)*pl(p).larm1.l,pl(p).larm1.y+sin(pl(p).larm1.rot)*pl(p).larm1.l,sh(t,0),sh(t,1),vc#/3) = 1
if pl(p).larm1.energy > sh(t,4)
dec pl(p).larm1.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).larm1.stick = 0 : pl(p).larm1.rotspeed = 3 : pl(p).larm1.vx = sh(t,2)/5 : pl(p).larm1.vy=sh(t,3)/5 : pl(p).larm1.energy = 0
endif
if pl(p).larm1.energy <= 0 then pl(p).larm1.stick = 0 : pl(p).larm1.rotspeed = 3 : pl(p).larm1.vx = sh(t,2)/5 : pl(p).larm1.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).downbody.x,pl(p).downbody.y,pl(p).downbody.x+cos(pl(p).downbody.rot)*pl(p).downbody.l,pl(p).downbody.y+sin(pl(p).downbody.rot)*pl(p).downbody.l,sh(t,0),sh(t,1),vc#/2) = 1
if pl(p).downbody.energy > sh(t,4)
dec pl(p).downbody.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).downbody.stick = 0 : pl(p).downbody.rotspeed = 3 : pl(p).downbody.vx = sh(t,2)/5 : pl(p).downbody.vy=sh(t,3)/5 : pl(p).downbody.energy = 0
endif
if pl(p).downbody.energy <= 0 then pl(p).downbody.stick = 0 : pl(p).downbody.rotspeed = 3 : pl(p).downbody.vx = sh(t,2)/5 : pl(p).downbody.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if PointinBox(pl(p).upbody.x,pl(p).upbody.y,pl(p).upbody.x+cos(pl(p).upbody.rot)*pl(p).upbody.l,pl(p).upbody.y+sin(pl(p).upbody.rot)*pl(p).upbody.l,sh(t,0),sh(t,1),vc#/2) = 1
if pl(p).upbody.energy > sh(t,4)
dec pl(p).upbody.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).upbody.stick = 0 : pl(p).upbody.rotspeed = 3 : pl(p).upbody.vx = sh(t,2)/5 : pl(p).upbody.vy=sh(t,3)/5 : pl(p).upbody.energy = 0
endif
if pl(p).upbody.energy <= 0 then pl(p).upbody.stick = 0 : pl(p).upbody.rotspeed = 3 : pl(p).upbody.vx = sh(t,2)/5 : pl(p).upbody.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
if sqrt((sh(t,0)-pl(p).head.x)^2+(sh(t,1)-pl(p).head.y)^2) < pl(p).head.size+vc#/2 and brk = 0
if pl(p).head.energy > sh(t,4)
dec pl(p).head.energy,sh(t,4)
dec pl(p).energy,sh(t,4)
else
pl(p).head.stick = 0 : pl(p).head.vx = sh(t,2)/5 : pl(p).head.vy=sh(t,3)/5
endif
if pl(p).head.energy <= 0 then pl(p).head.stick = 0 : pl(p).head.vx = sh(t,2)/5 : pl(p).head.vy=sh(t,3)/5
pl(p).hit_by = sh(t,5)
delete_shot(t)
endif
``if pl(p).energy <= 0 then sudden_death(p) : if roxor <> -1 then inc pl(int(sh(t,5))).frags,1
next p
For i = 0 to boxnr
if bx(i,0) <> 0 or bx(i,2) <> 0
if sh(t,0)>bx(i,0) and sh(t,1)>bx(i,1) and sh(t,0)<bx(i,2) and sh(t,1)<bx(i,3)
dust(sh(t,0),sh(t,1))
delete_shot(t)
endif
endif
next i
endif
next t
unlock pixels
return
shells:
ink 0,0
For t = 0 to maxshells
``Hülsen
if shell(t,0) <> 0 or shell(t,1) <> 0
if sprits = 1
rotate sprite 6,shell(t,4)
paste sprite 6,shell(t,0)-xscroll,shell(t,1)-yscroll
else
line shell(t,0)-cos(shell(t,4))*3-xscroll,shell(t,1)-sin(shell(t,4))*3-yscroll,shell(t,0)+cos(shell(t,4))*3-xscroll,shell(t,1)+sin(shell(t,4))*3-yscroll
endif
inc shell(t,0),shell(t,2)*slowmo : inc shell(t,1),shell(t,3)*slowmo
inc shell(t,3),grav*slowmo
inc shell(t,4),shell(t,5)*slowmo
if in_level(shell(t,0),shell(t,1)) = 1
shell(t,3) = -abs(shell(t,3))*.7
if shell(t,2) > 0.0 then dec shell(t,2),.05
if shell(t,2) < 0.0 then inc shell(t,2),.05
if shell(t,5) > 0.0 then dec shell(t,5),.1
``if shell(t,5) < 0.0 then inc shell(t,5),.02
endif
if shell(t,1) > 820+yscroll or shell(t,1) < -40+yscroll or shell(t,0) < -40+xscroll or shell(t,0) > 1064+xscroll then shell(t,1) = 0 : shell(t,0) = 0 : shell(t,2) = 0 : shell(t,3) = 0
endif
next t
return
ragdolling:
For t = 0 to maxplayers
if pl(t).head.stick = 0 or pl(t).stick = 0 then inc pl(t).head.x,pl(t).head.vx*slowmo : inc pl(t).head.y,pl(t).head.vy*slowmo : inc pl(t).head.vy,grav*slowmo : w = rnd(359) : if pl(t).head.stick = 0 then blod(pl(t).head.x+cos(w)*pl(t).head.size,pl(t).head.y+sin(w)*pl(t).head.size,w,5+rnd(5))
if pl(t).upbody.stick = 0 or pl(t).stick = 0
pl(t).upbody.energy=0 : pl(t).larm1.energy=0 : pl(t).larm2.energy=0 : pl(t).rarm1.energy=0 : pl(t).rarm2.energy=0 : pl(t).head.energy=0
inc pl(t).upbody.rot,pl(t).upbody.rotspeed*slowmo : inc pl(t).upbody.x,pl(t).upbody.vx*slowmo : inc pl(t).upbody.y,pl(t).upbody.vy*slowmo : inc pl(t).upbody.vy,grav*slowmo
if pl(t).upbody.stick = 0 then blod(pl(t).upbody.x,pl(t).upbody.y,pl(t).upbody.rot+180,5+rnd(3))
inc pl(t).larm1.rot,pl(t).upbody.rotspeed*slowmo+rnd(2) : inc pl(t).rarm1.rot,pl(t).upbody.rotspeed*slowmo+rnd(2)
inc pl(t).larm2.rot,pl(t).upbody.rotspeed*slowmo+rnd(2) : inc pl(t).rarm2.rot,pl(t).upbody.rotspeed*slowmo+rnd(2)
endif
if pl(t).downbody.stick = 0 or pl(t).stick = 0
pl(t).downbody.energy=0 : pl(t).lleg1.energy=0 : pl(t).lleg2.energy=0 : pl(t).rleg1.energy=0 : pl(t).rleg2.energy=0
inc pl(t).downbody.rot,pl(t).downbody.rotspeed*slowmo : inc pl(t).downbody.x,pl(t).downbody.vx*slowmo : inc pl(t).downbody.y,pl(t).downbody.vy*slowmo : inc pl(t).downbody.vy,grav*slowmo
if pl(t).downbody.stick = 0 then blod(pl(t).downbody.x,pl(t).downbody.y,pl(t).downbody.rot+180,5+rnd(3))
inc pl(t).lleg1.rot,pl(t).downbody.rotspeed*slowmo+rnd(2) : inc pl(t).rleg1.rot,pl(t).downbody.rotspeed*slowmo+rnd(2)
inc pl(t).lleg2.rot,pl(t).downbody.rotspeed*slowmo+rnd(2) : inc pl(t).rleg2.rot,pl(t).downbody.rotspeed*slowmo+rnd(2)
pl(t).walkspeed = 0
endif
if pl(t).larm1.stick = 0 or pl(t).stick = 0
pl(t).larm1.energy=0 : pl(t).larm2.energy=0
inc pl(t).larm1.rot,pl(t).larm1.rotspeed*slowmo : inc pl(t).larm1.x,pl(t).larm1.vx*slowmo : inc pl(t).larm1.y,pl(t).larm1.vy*slowmo : inc pl(t).larm1.vy,grav*slowmo
if pl(t).larm1.stick = 0 then blod(pl(t).larm1.x,pl(t).larm1.y,pl(t).larm1.rot+180,5+rnd(3))
inc pl(t).larm2.rot,pl(t).larm1.rotspeed*slowmo+rnd(2)
endif
if pl(t).larm2.stick = 0 or pl(t).stick = 0 then inc pl(t).larm2.rot,pl(t).larm2.rotspeed*slowmo : inc pl(t).larm2.x,pl(t).larm2.vx*slowmo : inc pl(t).larm2.y,pl(t).larm2.vy*slowmo : inc pl(t).larm2.vy,grav*slowmo : pl(t).larm2.energy=0 : if pl(t).larm2.stick = 0 then blod(pl(t).larm2.x,pl(t).larm2.y,pl(t).larm2.rot+180,5+rnd(3))
if pl(t).rarm1.stick = 0 or pl(t).stick = 0
pl(t).rarm1.energy=0 : pl(t).rarm2.energy=0
inc pl(t).rarm1.rot,pl(t).rarm1.rotspeed*slowmo : inc pl(t).rarm1.x,pl(t).rarm1.vx*slowmo : inc pl(t).rarm1.y,pl(t).rarm1.vy*slowmo : inc pl(t).rarm1.vy,grav*slowmo
if pl(t).rarm1.stick = 0 then blod(pl(t).rarm1.x,pl(t).rarm1.y,pl(t).rarm1.rot+180,5+rnd(3))
inc pl(t).rarm2.rot,pl(t).rarm1.rotspeed*slowmo+rnd(2)
endif
if pl(t).rarm2.stick = 0 or pl(t).stick = 0 then inc pl(t).rarm2.rot,pl(t).rarm2.rotspeed*slowmo : inc pl(t).rarm2.x,pl(t).rarm2.vx*slowmo : inc pl(t).rarm2.y,pl(t).rarm2.vy*slowmo : inc pl(t).rarm2.vy,grav*slowmo : pl(t).rarm2.energy=0 : if pl(t).rarm2.stick = 0 then blod(pl(t).rarm2.x,pl(t).rarm2.y,pl(t).rarm2.rot+180,5+rnd(3))
if pl(t).lleg1.stick = 0 or pl(t).stick = 0
if pl(t).rleg1.stick = 0 and pl(t).downbody.stick = 1 then pl(t).walkspeed = 2
if pl(t).rleg2.stick = 0 and pl(t).downbody.stick = 1 then pl(t).walkspeed = 3
pl(t).lleg1.energy=0 : pl(t).lleg2.energy=0
inc pl(t).lleg1.rot,pl(t).lleg1.rotspeed*slowmo : inc pl(t).lleg1.x,pl(t).lleg1.vx*slowmo : inc pl(t).lleg1.y,pl(t).lleg1.vy*slowmo : inc pl(t).lleg1.vy,grav*slowmo
if pl(t).lleg1.stick = 0 then blod(pl(t).lleg1.x,pl(t).lleg1.y,pl(t).lleg1.rot+180,5+rnd(3))
inc pl(t).lleg2.rot,pl(t).lleg1.rotspeed*slowmo+rnd(2)
endif
if pl(t).lleg2.stick = 0 or pl(t).stick = 0 then inc pl(t).lleg2.rot,pl(t).lleg2.rotspeed*slowmo : inc pl(t).lleg2.x,pl(t).lleg2.vx*slowmo : inc pl(t).lleg2.y,pl(t).lleg2.vy*slowmo : inc pl(t).lleg2.vy,grav*slowmo : pl(t).lleg2.energy=0 : if pl(t).lleg2.stick = 0 then blod(pl(t).lleg2.x,pl(t).lleg2.y,pl(t).lleg2.rot+180,5+rnd(3))
if pl(t).rleg1.stick = 0 or pl(t).stick = 0
pl(t).rleg1.energy=0 : pl(t).rleg2.energy=0
inc pl(t).rleg1.rot,pl(t).rleg1.rotspeed*slowmo : inc pl(t).rleg1.x,pl(t).rleg1.vx*slowmo : inc pl(t).rleg1.y,pl(t).rleg1.vy*slowmo : inc pl(t).rleg1.vy,grav*slowmo
if pl(t).rleg1.stick = 0 then blod(pl(t).rleg1.x,pl(t).rleg1.y,pl(t).rleg1.rot+180,5+rnd(3))
inc pl(t).rleg2.rot,pl(t).rleg1.rotspeed*slowmo+rnd(2)
endif
if pl(t).rleg2.stick = 0 or pl(t).stick = 0 then inc pl(t).rleg2.rot,pl(t).rleg2.rotspeed*slowmo : inc pl(t).rleg2.x,pl(t).rleg2.vx*slowmo : inc pl(t).rleg2.y,pl(t).rleg2.vy*slowmo : inc pl(t).rleg2.vy,grav*slowmo : pl(t).rleg2.energy=0 : if pl(t).rleg2.stick = 0 then blod(pl(t).rleg2.x,pl(t).rleg2.y,pl(t).rleg2.rot+180,5+rnd(3))
next t
return
control_weapons:
For t = 0 to maxweapons
if paused = 0 and wp(t).touched = 1 then dec wp(t).respawntime
if wp(t).respawntime <= 0 then weapon_respawn(t)
if wp(t).get = 1 then wp(t).touched = 1 : wp(t).respawntime = 1000
if wp(t).get = 0
draw_weapon(t,0)
inc wp(t).main.y,wp(t).main.vy
inc wp(t).main.x,wp(t).main.vx
if wp(t).main.vx > 0 then dec wp(t).main.vx,.1 else if wp(t).main.vx < 0 then inc wp(t).main.vx,.1
if wp(t).main.vx > -.5 and wp(t).main.vx < .5 then wp(t).main.vx = 0
inc wp(t).main.vy,grav
if wp(t).main.y > 3000 then weapon_respawn(t)
For i = 0 to boxnr
if wp(t).main.x+20 > bx(i,0) and wp(t).main.x-20 < bx(i,2)
if wp(t).main.y+20 > bx(i,1)-20 and wp(t).main.y+20 < bx(i,1)+20 then wp(t).main.vy = 0
endif
if wp(t).main.y+20 > bx(i,1)-20 and wp(t).main.y-20 < bx(i,3)
if wp(t).main.x-20 < bx(i,2) and wp(t).main.x-20 > bx(i,2)-10-abs(wp(t).main.vx) then wp(t).main.vx = abs(wp(t).main.vx)*.9
if wp(t).main.x+20 > bx(i,0) and wp(t).main.x+20 < bx(i,0)+10+abs(wp(t).main.vx) then wp(t).main.vx = -abs(wp(t).main.vx)*.9
endif
next i
For i = 0 to maxplayers
if pl(i).wpn = -1
if pl(i).x > wp(t).main.x-30 and pl(i).x < wp(t).main.x+30
if pl(i).y > wp(t).main.y-70 and pl(i).y < wp(t).main.y+70
if wp(t).twohanded = 0 and (pl(i).rarm2.energy > 0 or pl(i).larm2.energy > 0)
wp(t).get = 1
pl(i).wpn = t
endif
if wp(t).twohanded = 1 and pl(i).rarm2.energy > 0 and pl(i).larm2.energy > 0
wp(t).get = 1
pl(i).wpn = t
endif
endif
endif
endif
next i
endif
next t
return
Level1Data:
data 0
data 4
data 1
data -1200,600,2200,4900
data -800,500
data -300,500
data 512,500
data 1800,500
data 1300,500
data 0,500
data 1000,500
return
Level2Data:
data 12
data 3
data 3
data -300,650,1000,900
data 2100,550,3000,900
data 2400,425,2500,900
data -100,50,1000,350
data 1200,600,1900,700
data 1600,750,2000,1000
data -600,550,-90,1000
data -600,-150,-500,1000
data -600,-150,-500,1000
data -600,400,-350,500
data -200,290,0,340
data -600,150,-450,200
data 2800,425,3600,500
data 512,-50
data -300,0
data 500,500
data 2450,300
data 450,-50
data -330,30
data 450,500
data 2350,300
return
Level3Data:
data 28
data 4
data 7
data -1500,0,0,3700
data -100,1550,100,2200
data -100,1700,150,2200
data -100,1850,300,2200
data -100,2000,400,2200
data -200,2100,900,3400
data 300,1400,600,1600
data 500,1300,900,1700
data 1350,900,1800,1070
data 1250,1050,1950,1150
data 1200,1300,2000,1600
data 1200,1400,1300,1700
data 1900,1400,2000,1700
data 1200,2100,2000,3400
data 2200,1150,2700,1300
``data 2400,1000,2800,1200
data 2550,300,4000,1300
data 2350,2200,2600,3400
data 2300,2050,3700,2300
data 2500,1900,2800,2200
data 3000,1900,3200,2200
data -1500,-500,200,1000
data 100,300,350,1000
data 100,300,350,1000
data 200,400,450,600
data 200,550,550,800
data -100,700,800,1000
data 700,800,1000,900
data 650,130,2000,300
data -100,1800,200,2200
data 3200,100
data 1600,600
data 1600,1900
data 1600,1150
data 3100,1700
data 1300,2000
data 1900,2000
data 750,600
data 3800,200
data 700,1200
data 3450,1950
data 1400,0
data 2700,200
return
Pathdata:
data 800,284,800,100,1000,100,1000,150,1200,150
data 100,384,100,200,0,200,0,400,-100,400
data 512,-400,512,-500,512,-700,512,-750,512,-800
return
function sudden_death(t)
if pl(t).energy > -1000
dec pl(t).frags,1
pl(t).energy = -1000
pl(t).upbody.stick = 0 : pl(t).upbody.vx = -30+rnd(60) : pl(t).upbody.vy = -30+rnd(60) : pl(t).upbody.rotspeed = -4+rnd(8)
pl(t).downbody.stick = 0 : pl(t).downbody.vx = 0 : pl(t).downbody.vy = 0 : pl(t).downbody.rotspeed = -4+rnd(8)
pl(t).larm1.stick = 0 : pl(t).larm1.vx = -30+rnd(60) : pl(t).larm1.vy = -30+rnd(60) : pl(t).larm1.rotspeed = -4+rnd(8)
pl(t).rarm1.stick = 0 : pl(t).rarm1.vx = -30+rnd(60) : pl(t).rarm1.vy = -30+rnd(60) : pl(t).rarm1.rotspeed = -4+rnd(8)
pl(t).rarm2.stick = 0 : pl(t).rarm2.vx = -30+rnd(60) : pl(t).rarm2.vy = -30+rnd(60) : pl(t).rarm2.rotspeed = -4+rnd(8)
pl(t).larm2.stick = 0 : pl(t).larm2.vx = -30+rnd(60) : pl(t).larm2.vy = -30+rnd(60) : pl(t).larm2.rotspeed = -4+rnd(8)
pl(t).lleg1.stick = 0 : pl(t).lleg1.vx = -30+rnd(60) : pl(t).lleg1.vy = -30+rnd(60) : pl(t).lleg1.rotspeed = -4+rnd(8)
pl(t).lleg2.stick = 0 : pl(t).lleg2.vx = -30+rnd(60) : pl(t).lleg2.vy = -30+rnd(60) : pl(t).lleg2.rotspeed = -4+rnd(8)
pl(t).rleg2.stick = 0 : pl(t).rleg2.vx = -30+rnd(60) : pl(t).rleg2.vy = -30+rnd(60) : pl(t).rleg2.rotspeed = -4+rnd(8)
pl(t).head.stick = 0 : pl(t).head.vx = -30+rnd(60) : pl(t).head.vy = -30+rnd(60)
endif
endfunction
function die(t,jumpheight)
if bagholder = t then bagholder = -1 : bagrespawntime = 5000
if pl(t).energy > -1000
if pl(t).hit_by = 0 then inc stats(0),1 : if plslowmo <= 90 then inc plslowmo,10
if pl(t).hit_by <> -1 and mode = 1 then inc pl(pl(t).hit_by).frags : pl(t).hit_by = -1
if t = 0 then inc stats(1),1
pl(t).vy = -jumpheight
pl(t).energy = -1000
pl(t).stick = 0
pl(t).upbody.rotspeed = -4+rnd(8)
pl(t).downbody.rotspeed = pl(t).upbody.rotspeed
pl(t).larm1.rotspeed = -4+rnd(8) : pl(t).larm2.rotspeed = -4+rnd(8)
pl(t).rarm1.rotspeed = -4+rnd(8) : pl(t).rarm2.rotspeed = -4+rnd(8)
pl(t).lleg1.rotspeed = -4+rnd(8) : pl(t).lleg2.rotspeed = -4+rnd(8)
pl(t).rleg1.rotspeed = -4+rnd(8) : pl(t).rleg2.rotspeed = -4+rnd(8)
endif
endfunction
function jump(t,str)
if pl(t).onfloor = 1
if pl(t).lleg1.energy > 0 and pl(t).rleg1.energy > 1
pl(t).vy = -str
else
pl(t).j_allowed = 0
endif
endif
endfunction
function drop_weapon(t,direc)
if pl(t).wpn <> -1
if in_level(wp(pl(t).wpn).main.x-44+(pl(t).direc*88),wp(pl(t).wpn).main.y) = 0
dec wp(pl(t).wpn).main.y,50
if direc = 1
inc wp(pl(t).wpn).main.x,35+abs(pl(t).vx)*2
wp(pl(t).wpn).main.vx = 5
wp(pl(t).wpn).main.vy = -2
else
dec wp(pl(t).wpn).main.x,35+abs(pl(t).vx)*2
wp(pl(t).wpn).main.vx = -5
wp(pl(t).wpn).main.vy = -2
endif
wp(pl(t).wpn).get = 0
pl(t).wpn = -1
endif
endif
endfunction
function player_shoot(t)
if timer()-pl(t).tim > wp(pl(t).wpn).speed/slowmo and pl(t).wpn <> -1 and wp(pl(t).wpn).get = 1
x = wp(pl(t).wpn).main.x+cos(wp(pl(t).wpn).main.rot)*(wp(pl(t).wpn).main.l-wp(pl(t).wpn).griff1.pos)+pl(t).vx
y = wp(pl(t).wpn).main.y+sin(wp(pl(t).wpn).main.rot)*(wp(pl(t).wpn).main.l-wp(pl(t).wpn).griff1.pos)+pl(t).vy
if in_level(x,y) = 0 then shoot(x,y,wp(pl(t).wpn).main.rot,wp(pl(t).wpn).bulletspeed,wp(pl(t).wpn).bullets,wp(pl(t).wpn).ung,wp(pl(t).wpn).damage,pl(t).direc,t,wp(pl(t).wpn).laser,wp(pl(t).wpn).sound)
pl(t).tim = timer()
endif
endfunction
function shoot(x,y,win,speed,amount,ung,damage,direc,from,laser,sound)
if x > xscroll-200 and y > yscroll-200 and x < xscroll+1200 and y < yscroll+790
circle x-xscroll,y-yscroll,4+rnd(3)
if sound <> 0
play sound sound
endif
For t = 1 to amount
sh(momshot,0) = x
sh(momshot,1) = y
random = rnd(ung)
sh(momshot,2) = cos(win-ung/2+random)*speed
sh(momshot,3) = sin(win-ung/2+random)*speed
sh(momshot,4) = damage
sh(momshot,5) = from
sh(momshot,6) = laser
shell(momshell,0) = x-cos(win)*20
shell(momshell,1) = y-sin(win)*20
shell(momshell,5) = 3.0
shellpower = 4+rnd(1)
if direc = 1
shell(momshell,2) = cos(win-110-ung/2+random)*shellpower
shell(momshell,3) = sin(win-110-ung/2+random)*shellpower
else
shell(momshell,2) = cos(win+110-ung/2+random)*shellpower
shell(momshell,3) = sin(win+110-ung/2+random)*shellpower
endif
shell(momshell,4) = rnd(359)
inc momshell : if momshell > maxshells then momshell = 0
inc momshot : if momshot > maxshots then momshot = 0
next t
endif
endfunction
function delete_shot(t)
sh(t,0) = 0 : sh(t,1) = 0
sh(t,2) = 0 : sh(t,3) = 0
sh(t,4) = 0 : sh(t,5) = 0
sh(t,6) = 0
endfunction
function blod(x,y,win,speed)
if x > xscroll-150 and x < xscroll+1174 and y > yscroll-150 and y < yscroll+918
bl(momblood,4) = 255
bl(momblood,0) = x
bl(momblood,1) = y
random = rnd(6)
bl(momblood,2) = cos(win-3+random)*speed
bl(momblood,3) = sin(win-3+random)*speed
inc momblood : if momblood > maxblood then momblood = 0
endif
endfunction
function dust(x,y)
if x > xscroll-150 and x < xscroll+1174 and y > yscroll-150 and y < yscroll+918
For t = 0 to 60
prt(momprt,0) = x
prt(momprt,1) = y
win = rnd(359) : str = 1+rnd(7)
prt(momprt,2) = cos(win)*str
prt(momprt,3) = sin(win)*str
inc momprt : if momprt > maxparticles then momprt = 0
next t
endif
endfunction
function walk_right(t,speed#)
if pl(t).vx < speed# then inc pl(t).vx,.5*slowmo
if pl(t).direc = 0
pl(t).direc = 1
if pl(t).downbody.energy > 0
pl(t).lleg1.rot = 90 : pl(t).rleg1.rot = 90
pl(t).lleg2.rot = 110 : pl(t).rleg2.rot = 110
endif
if pl(t).upbody.energy > 0
pl(t).larm1.rot = 150 : pl(t).rarm1.rot = 45
pl(t).larm2.rot = 25 : pl(t).rarm2.rot = 10
pl(t).upbody.rot = 275
endif
if pl(t).downbody.energy > 0 then pl(t).downbody.rot = 95
endif
if pl(t).lleg1.energy > 0
if pl(t).framem = 0
inc pl(t).lleg1.rot,5*slowmo
dec pl(t).rleg1.rot,5*slowmo
inc pl(t).lleg2.rot,7*slowmo
dec pl(t).rleg2.rot,7*slowmo
inc pl(t).upbody.rot,.5*slowmo : inc pl(t).downbody.rot,.5*slowmo
else
dec pl(t).lleg1.rot,5*slowmo
inc pl(t).rleg1.rot,5*slowmo
dec pl(t).lleg2.rot,7*slowmo
inc pl(t).rleg2.rot,7*slowmo
dec pl(t).upbody.rot,.5*slowmo : dec pl(t).downbody.rot,.5*slowmo
endif
endif
if pl(t).lleg1.rot > 130 then pl(t).framem = 1
if pl(t).lleg1.rot < 50 then pl(t).framem = 0
endfunction
function walk_left(t,speed#)
if pl(t).vx > -speed# then dec pl(t).vx,.5*slowmo
if pl(t).direc = 1
pl(t).direc = 0
if pl(t).downbody.energy > 0
pl(t).lleg1.rot = 90 : pl(t).rleg1.rot = 90
pl(t).lleg2.rot = 70 : pl(t).rleg2.rot = 70
endif
if pl(t).upbody.energy > 0
pl(t).larm1.rot = 135 : pl(t).rarm1.rot = 30
pl(t).larm2.rot = 170 : pl(t).rarm2.rot = 155
pl(t).upbody.rot = 265
endif
if pl(t).downbody.energy > 0 then pl(t).downbody.rot = 85
endif
if pl(t).lleg1.energy > 0
if pl(t).framem = 0
inc pl(t).lleg1.rot,5*slowmo
dec pl(t).rleg1.rot,5*slowmo
inc pl(t).lleg2.rot,7*slowmo
dec pl(t).rleg2.rot,7*slowmo
inc pl(t).upbody.rot,.5*slowmo : inc pl(t).downbody.rot,.5*slowmo
else
dec pl(t).lleg1.rot,5*slowmo
inc pl(t).rleg1.rot,5*slowmo
dec pl(t).lleg2.rot,7*slowmo
inc pl(t).rleg2.rot,7*slowmo
dec pl(t).upbody.rot,.5*slowmo : dec pl(t).downbody.rot,.5*slowmo
endif
endif
if pl(t).lleg1.rot > 130 then pl(t).framem = 1
if pl(t).lleg1.rot < 50 then pl(t).framem = 0
endfunction
function stick(t)
if pl(t).upbody.stick = 1 then pl(t).upbody.x = pl(t).x : pl(t).upbody.y = pl(t).y
if pl(t).downbody.stick = 1 then pl(t).downbody.x = pl(t).x : pl(t).downbody.y = pl(t).y
if pl(t).head.stick = 1 then pl(t).head.x = pl(t).upbody.x+cos(pl(t).upbody.rot)*(pl(t).upbody.l+pl(t).head.size)
if pl(t).head.stick = 1 then pl(t).head.y = pl(t).upbody.y+sin(pl(t).upbody.rot)*(pl(t).upbody.l+pl(t).head.size)
if pl(t).larm1.stick = 1 then pl(t).larm1.x = pl(t).upbody.x+cos(pl(t).upbody.rot)*(pl(t).upbody.l*.8)
if pl(t).larm1.stick = 1 then pl(t).larm1.y = pl(t).upbody.y+sin(pl(t).upbody.rot)*(pl(t).upbody.l*.8)
if pl(t).larm2.stick = 1 then pl(t).larm2.x = pl(t).larm1.x+cos(pl(t).larm1.rot)*pl(t).larm1.l
if pl(t).larm2.stick = 1 then pl(t).larm2.y = pl(t).larm1.y+sin(pl(t).larm1.rot)*pl(t).larm1.l
if pl(t).rarm1.stick = 1 then pl(t).rarm1.x = pl(t).upbody.x+cos(pl(t).upbody.rot)*(pl(t).upbody.l*.8)
if pl(t).rarm1.stick = 1 then pl(t).rarm1.y = pl(t).upbody.y+sin(pl(t).upbody.rot)*(pl(t).upbody.l*.8)
if pl(t).rarm2.stick = 1 then pl(t).rarm2.x = pl(t).rarm1.x+cos(pl(t).rarm1.rot)*pl(t).rarm1.l
if pl(t).rarm2.stick = 1 then pl(t).rarm2.y = pl(t).rarm1.y+sin(pl(t).rarm1.rot)*pl(t).rarm1.l
if pl(t).lleg1.stick = 1 then pl(t).lleg1.x = pl(t).downbody.x+cos(pl(t).downbody.rot)*pl(t).downbody.l
if pl(t).lleg1.stick = 1 then pl(t).lleg1.y = pl(t).downbody.y+sin(pl(t).downbody.rot)*pl(t).downbody.l
if pl(t).lleg2.stick = 1 then pl(t).lleg2.x = pl(t).lleg1.x+cos(pl(t).lleg1.rot)*pl(t).lleg1.l
if pl(t).lleg2.stick = 1 then pl(t).lleg2.y = pl(t).lleg1.y+sin(pl(t).lleg1.rot)*pl(t).lleg1.l
if pl(t).rleg1.stick = 1 then pl(t).rleg1.x = pl(t).downbody.x+cos(pl(t).downbody.rot)*pl(t).downbody.l
if pl(t).rleg1.stick = 1 then pl(t).rleg1.y = pl(t).downbody.y+sin(pl(t).downbody.rot)*pl(t).downbody.l
if pl(t).rleg2.stick = 1 then pl(t).rleg2.x = pl(t).rleg1.x+cos(pl(t).rleg1.rot)*pl(t).rleg1.l
if pl(t).rleg2.stick = 1 then pl(t).rleg2.y = pl(t).rleg1.y+sin(pl(t).rleg1.rot)*pl(t).rleg1.l
if pl(t).wpn <> -1
if wp(pl(t).wpn).twohanded = 1
if pl(t).larm2.energy <= 0 or pl(t).rarm2.energy <= 0 then drop_weapon(t,pl(t).direc)
larm2endx = pl(t).larm2.x+cos(pl(t).larm2.rot)*pl(t).larm2.l
larm2endy = pl(t).larm2.y+sin(pl(t).larm2.rot)*pl(t).larm2.l
rarm2endx = pl(t).rarm2.x+cos(pl(t).rarm2.rot)*pl(t).rarm2.l
rarm2endy = pl(t).rarm2.y+sin(pl(t).rarm2.rot)*pl(t).rarm2.l
if pl(t).larm2.energy > 0 and pl(t).rarm2.energy > 0
if pl(t).direc = 1
wp(pl(t).wpn).main.x = larm2endx : wp(pl(t).wpn).main.y = larm2endy
wp(pl(t).wpn).main.rot = atan_full(larm2endx-rarm2endx,larm2endy-rarm2endy)
else
wp(pl(t).wpn).main.x = rarm2endx : wp(pl(t).wpn).main.y = rarm2endy
wp(pl(t).wpn).main.rot = atan_full(rarm2endx-larm2endx,rarm2endy-larm2endy)
endif
endif
else
larm2endx = pl(t).larm2.x+cos(pl(t).larm2.rot)*pl(t).larm2.l
larm2endy = pl(t).larm2.y+sin(pl(t).larm2.rot)*pl(t).larm2.l
rarm2endx = pl(t).rarm2.x+cos(pl(t).rarm2.rot)*pl(t).rarm2.l
rarm2endy = pl(t).rarm2.y+sin(pl(t).rarm2.rot)*pl(t).rarm2.l
if pl(t).direc = 1
if pl(t).rarm2.energy > 0
wp(pl(t).wpn).main.x = rarm2endx : wp(pl(t).wpn).main.y = rarm2endy
wp(pl(t).wpn).main.rot = pl(t).rarm2.rot
else
wp(pl(t).wpn).main.x = larm2endx : wp(pl(t).wpn).main.y = larm2endy
wp(pl(t).wpn).main.rot = pl(t).larm2.rot
endif
else
if pl(t).larm2.energy > 0
wp(pl(t).wpn).main.x = larm2endx : wp(pl(t).wpn).main.y = larm2endy
wp(pl(t).wpn).main.rot = pl(t).larm2.rot
else
wp(pl(t).wpn).main.x = rarm2endx : wp(pl(t).wpn).main.y = rarm2endy
wp(pl(t).wpn).main.rot = pl(t).rarm2.rot
endif
endif
endif
endif
if pl(t).wpn <> -1 and pl(t).bot = 1 then pl(t).botwin = wp(pl(t).wpn).main.rot
endfunction
function skill(value)
if value = 0 then string$ = "Normal" else string$ = "Gut"
endfunction string$
function beleben(t,x,y)
pl(t).energy = 50.0
pl(t).x = x : pl(t).vx = 0.0
pl(t).y = y : pl(t).vy = 0.0
pl(t).walkspeed = 10
pl(t).direc = 1
pl(t).j_allowed = 1
pl(t).stick = 1
if pl(t).wpn <> -1
wp(pl(t).wpn).get = 0
pl(t).wpn = -1
endif
if t = 0 and plslowmo => 5 then dec plslowmo,5
pl(t).hit_by = -1
pl(t).respawntime = respawntimer
if pl(t).bot = 1 then pl(t).botdir = rnd(1)
pl(t).head.x = pl(t).x : pl(t).head.size = 12 : pl(t).head.y = pl(t).y-35-pl(t).head.size : pl(t).head.energy = 10 : pl(t).head.stick = 1 : pl(t).head.vx = 0 : pl(t).head.vy = 0
pl(t).upbody.x = pl(t).x : pl(t).upbody.y = pl(t).y : pl(t).upbody.rot = 270 : pl(t).upbody.l = 35 : pl(t).upbody.energy = 10 : pl(t).upbody.stick = 1 : pl(t).upbody.vx = 0 : pl(t).upbody.vy = 0
pl(t).downbody.x = pl(t).x : pl(t).downbody.y = pl(t).y : pl(t).downbody.rot = 90 : pl(t).downbody.l = 35 : pl(t).downbody.energy = 10 : pl(t).downbody.stick = 1 : pl(t).downbody.vx = 0 : pl(t).downbody.vy = 0
pl(t).larm1.x = pl(t).x : pl(t).larm1.y = pl(t).y-30 : pl(t).larm1.rot = 140 : pl(t).larm1.l = 20 : pl(t).larm1.energy = 10 : pl(t).larm1.stick = 1 : pl(t).larm1.vx = 0 : pl(t).larm1.vy = 0
pl(t).larm2.rot = 120 : pl(t).larm2.l = 20 : pl(t).larm2.energy = 10 : pl(t).larm2.stick = 1 : pl(t).larm2.vx = 0 : pl(t).larm2.vy = 0
pl(t).rarm1.x = pl(t).x : pl(t).rarm1.y = pl(t).y-30 : pl(t).rarm1.rot = 40 : pl(t).rarm1.l = 20 : pl(t).rarm1.energy = 10 : pl(t).rarm1.stick = 1 : pl(t).rarm1.vx = 0 : pl(t).rarm1.vy = 0
pl(t).rarm2.rot = 60 : pl(t).rarm2.l = 20 : pl(t).rarm2.energy = 10 : pl(t).rarm2.stick = 1 : pl(t).rarm2.vx = 0 : pl(t).rarm2.vy = 0
pl(t).lleg1.x = pl(t).x : pl(t).lleg1.y = pl(t).y+35 : pl(t).lleg1.rot = 140 : pl(t).lleg1.l = 20 : pl(t).lleg1.energy = 10 : pl(t).lleg1.stick = 1 : pl(t).lleg1.vx = 0 : pl(t).lleg1.vy = 0
pl(t).lleg2.rot = 120 : pl(t).lleg2.l = 20 : pl(t).lleg2.energy = 10 : pl(t).lleg2.stick = 1 : pl(t).lleg2.vx = 0 : pl(t).lleg2.vy = 0
pl(t).rleg1.x = pl(t).x : pl(t).rleg1.y = pl(t).y+35 : pl(t).rleg1.rot = 40 : pl(t).rleg1.l = 20 : pl(t).rleg1.energy = 10 : pl(t).rleg1.stick = 1 : pl(t).rleg1.vx = 0 : pl(t).rleg1.vy = 0
pl(t).rleg2.rot = 60 : pl(t).rleg2.l = 20 : pl(t).rleg2.energy = 10 : pl(t).rleg2.stick = 1 : pl(t).rleg2.vx = 0 : pl(t).rleg2.vy = 0
pl(t).lleg1.rot = 90 : pl(t).rleg1.rot = 90
pl(t).lleg2.rot = 110 : pl(t).rleg2.rot = 110
pl(t).larm1.rot = 150 : pl(t).rarm1.rot = 45
pl(t).larm2.rot = 25 : pl(t).rarm2.rot = 10
pl(t).upbody.rot = 275 : pl(t).downbody.rot = 95
endfunction
function draw_player(t)
if pl(t).wpn <> -1 then draw_weapon(pl(t).wpn,pl(t).direc)
if sprits = 0
ink 0,0
circle pl(t).head.x-xscroll,pl(t).head.y-yscroll,pl(t).head.size
line pl(t).upbody.x-xscroll,pl(t).upbody.y-yscroll,pl(t).upbody.x+cos(pl(t).upbody.rot)*pl(t).upbody.l-xscroll,pl(t).upbody.y+sin(pl(t).upbody.rot)*pl(t).upbody.l-yscroll
line pl(t).downbody.x-xscroll,pl(t).downbody.y-yscroll,pl(t).downbody.x+cos(pl(t).downbody.rot)*pl(t).downbody.l-xscroll,pl(t).downbody.y+sin(pl(t).downbody.rot)*pl(t).downbody.l-yscroll
line pl(t).larm1.x-xscroll,pl(t).larm1.y-yscroll,pl(t).larm1.x+cos(pl(t).larm1.rot)*pl(t).larm1.l-xscroll,pl(t).larm1.y+sin(pl(t).larm1.rot)*pl(t).larm1.l-yscroll
line pl(t).larm2.x-xscroll,pl(t).larm2.y-yscroll,pl(t).larm2.x+cos(pl(t).larm2.rot)*pl(t).larm2.l-xscroll,pl(t).larm2.y+sin(pl(t).larm2.rot)*pl(t).larm2.l-yscroll
line pl(t).rarm1.x-xscroll,pl(t).rarm1.y-yscroll,pl(t).rarm1.x+cos(pl(t).rarm1.rot)*pl(t).rarm1.l-xscroll,pl(t).rarm1.y+sin(pl(t).rarm1.rot)*pl(t).rarm1.l-yscroll
line pl(t).rarm2.x-xscroll,pl(t).rarm2.y-yscroll,pl(t).rarm2.x+cos(pl(t).rarm2.rot)*pl(t).rarm2.l-xscroll,pl(t).rarm2.y+sin(pl(t).rarm2.rot)*pl(t).rarm2.l-yscroll
line pl(t).lleg1.x-xscroll,pl(t).lleg1.y-yscroll,pl(t).lleg1.x+cos(pl(t).lleg1.rot)*pl(t).lleg1.l-xscroll,pl(t).lleg1.y+sin(pl(t).lleg1.rot)*pl(t).lleg1.l-yscroll
line pl(t).lleg2.x-xscroll,pl(t).lleg2.y-yscroll,pl(t).lleg2.x+cos(pl(t).lleg2.rot)*pl(t).lleg2.l-xscroll,pl(t).lleg2.y+sin(pl(t).lleg2.rot)*pl(t).lleg2.l-yscroll
line pl(t).rleg1.x-xscroll,pl(t).rleg1.y-yscroll,pl(t).rleg1.x+cos(pl(t).rleg1.rot)*pl(t).rleg1.l-xscroll,pl(t).rleg1.y+sin(pl(t).rleg1.rot)*pl(t).rleg1.l-yscroll
line pl(t).rleg2.x-xscroll,pl(t).rleg2.y-yscroll,pl(t).rleg2.x+cos(pl(t).rleg2.rot)*pl(t).rleg2.l-xscroll,pl(t).rleg2.y+sin(pl(t).rleg2.rot)*pl(t).rleg2.l-yscroll
else
``Sprite Version
size sprite 2,pl(t).head.size*2,pl(t).head.size*2 : offset sprite 2,pl(t).head.size,pl(t).head.size
paste sprite 2,pl(t).head.x-xscroll,pl(t).head.y-yscroll
size sprite 1,pl(t).upbody.l,3 : rotate sprite 1,pl(t).upbody.rot
paste sprite 1,pl(t).upbody.x-xscroll,pl(t).upbody.y-yscroll
size sprite 1,pl(t).downbody.l,3 : rotate sprite 1,pl(t).downbod
stargate sg-1 the one show that never gets old