- PvP Craft
- 12 Dec 2013 05:39:01 pm
- Last edited by FrozenFire49 on 12 Dec 2013 05:43:35 pm; edited 1 time in total
Being that it lost in contest #11, there is a lot of work still to be done on the game.
Throughout testing the game, I've noticed that it was running a little slow, even on its fastest settings. As I haven't compared the speed of anything yet, I have know idea what would make the program run faster. Here is the source code:
Code:
Also, what do you think of the name? The first name was Arena Craft, it is now PvP Craft, and assemblybandit suggested Kill Craft in the contest forum.
Here is the beta. I've made no changes on it since the submission to the contest.
http://download1321.mediafire.com/8epiahq866qg/hpcbfgxrhrykpcv/PVPCRAFT.8xp
Throughout testing the game, I've noticed that it was running a little slow, even on its fastest settings. As I haven't compared the speed of anything yet, I have know idea what would make the program run faster. Here is the source code:
Code:
::DCS
:"FFF0000000000888FD0F000000008918F0D0F000000891980F0D0F000089198000F0D0F008919800000F0D0F8919800
00088F0D89198FF0000818F89198FEF000008189198FDF000000818198DFDF00000008188FFDF0000000778118DF77000
0077708818077700887700FF880077FF8180000000000FEF8880000000000FFF"
:If 80>det([[20
:Then
:Disp "Doors CSE Required"
:Return
:End
:DelVar ∟WALLDelVar ∟YAXISDelVar ∟XAXISDelVar ∟LIVESDelVar ∟ENEMYDelVar ∟BLOCKDelVar ∟LEVELDelVar Str1DelVar ADelVar BDelVar CDelVar DDelVar EDelVar FDelVar GDelVar HDelVar IDelVar JDelVar KDelVar LDelVar MDelVar NDelVar ODelVar PDelVar QDelVar RDelVar SDelVar TDelVar UDelVar VDelVar WDelVar XDelVar YDelVar ZDelVar θ
:Lbl 12
:ClrHome
:Menu(" PvP Craft ","Play",13,"Controls",14,"Quit",15
:Lbl 14
:Disp "Arrows:Move/Mine/Attack"
:Disp ""
:Disp "MODE,STAT,APPS,ALPHA:Place"
:Disp ""
:Disp "XTθn:Jump,Place"
:Disp ""
:Disp "2ND:Sword Store"
:Disp ""
:Disp "DEL:Pickaxe Store"
:Repeat D≠0
:getKey→D
:End
:Goto 12
:Lbl 15
:Return
:Lbl 13
:Menu(" Number Of Enemies ","One (Fastest)",6,"Two",7,"Three",8,"Four",9,"Five (Slowest)",10,"Back",12
:Lbl 6
:1→F
:Goto 11
:Lbl 7
:2→F
:Goto 11
:Lbl 8
:3→F
:Goto 11
:Lbl 9
:4→F
:Goto 11
:Lbl 10
:5→F
:Lbl 11
:F→dim(∟YAXIS
:F→dim(∟XAXIS
:F→dim(∟LIVES
:F→dim(∟ENEMY
:F→dim(∟BLOCK
:F→dim(∟LEVEL
:10→C
:For(E,1,F
:10→∟LIVES(E
:End
:0→dim(∟WALL
:randInt(1,10)→P
:randInt(1,26)→Q
:Menu(" Terrain Size ","Tiny (Fastest)",1,"Small",2,"Medium",3,"Large",4,"Huge (Slowest)",5,"Back",13
:Lbl 1
:randInt(1,40)→M
:Goto 0
:Lbl 2
:randInt(41,80)→M
:Goto 0
:Lbl 3
:randInt(81,120)→M
:Goto 0
:Lbl 4
:randInt(121,160)→M
:Goto 0
:Lbl 5
:randInt(161,200)→M
:Lbl 0
:ClrHome
:For(N,1,M
:Repeat R<5
:randInt(1,9)→O
:If O=1 or O=6
:P+1→P
:If O=2 or O=7
:P-1→P
:If O=3 or O=8
:Q+1→Q
:If O=4 or O=9
:Q-1→Q
:If P=0
:1→P
:If P=11
:10→P
:If Q=0
:1→Q
:If Q=27
:26→Q
:If O=5
:Then
:randInt(1,10)→P
:randInt(1,26)→Q
:End
:dim(∟WALL)+1→dim(∟WALL
:sum(P*100+Q=∟WALL→R
:End
:If R=4
:det(12,BLACK,BLACK
:If R=3
:det(12,DARKGRAY,DARKGRAY
:If R=2
:det(12,GRAY,GRAY
:If R=1
:det(12,MEDGRAY,MEDGRAY
:If R=0
:det(12,LTGRAY,LTGRAY
:Output(P,Q," "
:P*100+Q→∟WALL(dim(∟WALL
:End
:DelVar PDelVar QDelVar NDelVar M
:det(12,300
:randInt(1,10)→A
:randInt(1,26)→B
:For(E,1,F
:randInt(1,10)→∟YAXIS(E
:randInt(1,26)→∟XAXIS(E
:∟YAXIS(E)*100+∟XAXIS(E)→∟ENEMY(E)
:End
:While max(A*100+B=∟WALL
:randInt(1,10)→A
:randInt(1,26)→B
:End
:For(E,1,F
:While max(∟YAXIS(E)*100+∟XAXIS(E)=∟WALL or (A=∟YAXIS(E) and B=∟XAXIS(E
:randInt(1,10)→∟YAXIS(E
:randInt(1,26)→∟XAXIS(E
:End
:End
:det(12,GREEN,WHITE
:Output(A,B,"θ"
:det(12,RED,WHITE
:For(E,1,F
:Output(∟YAXIS(E),∟XAXIS(E),"θ"
:End
:"Gold Wood Stone Iron Diamond"→Str1
:Repeat D=45 or C≤0 or max(∟LIVES)≤0
:getKey→D
:det(12,300
:If D=21
:Then
:ClrHome
:Disp " Sword Damage Uses Cost"
:Disp "1:Gold 2 10 05"
:Disp "2:Wood 2 20 10"
:Disp "3:Stone 3 30 20"
:Disp "4:Iron 4 40 30"
:Disp "5:Diamond 5 50 40"
:Disp " INVENTORY"
:Output(10,3,"Hand 1 --"
:Output(10,23,G
:If W≠0
:Then
:Output(8,3,sub(Str1,7W-6,7
:If W=1
:Output(8,13,"2"
:If W≥2
:Output(8,13,W
:Output(8,18,Y
:End
:If X≠0
:Then
:Output(9,3,sub(Str1,7X-6,7
:If X=1
:Output(9,13,"2"
:If X≥2
:Output(9,13,X
:Output(9,18,10X
:End
:Repeat D≠0
:getKey→D
:End
:If X=0
:Then
:If W≠0
:Then
:If D=92 and G≥5
:1→X
:If D=93 and G≥10
:2→X
:If D=94 and G≥20
:3→X
:If D=82 and G≥30
:4→X
:If D=83 and G≥40
:5→X
:End
:If W=0
:Then
:If D=92 and G≥5
:1→W
:If D=93 and G≥10
:2→W
:If D=94 and G≥20
:3→W
:If D=82 and G≥30
:4→W
:If D=83 and G≥40
:5→W
:10W→Y
:End
:If D=92 and G≥5
:G-5→G
:If D=93 and G≥10
:G-10→G
:If D=94 and G≥20
:G-20→G
:If D=82 and G≥30
:G-30→G
:If D=83 and G≥40
:G-40→G
:End
:ClrHome
:For(S,1,dim(∟WALL
:If ∟WALL(S)≠0
:Then
:int(∟WALL(S)/100)→T
:∟WALL(S)-T*100→U
:sum(T*100+U=∟WALL→R
:If R=5
:det(12,BLACK,BLACK
:If R=4
:det(12,DARKGRAY,DARKGRAY
:If R=3
:det(12,GRAY,GRAY
:If R=2
:det(12,MEDGRAY,MEDGRAY
:If R=1
:det(12,LTGRAY,LTGRAY
:Output(T,U," "
:End
:End
:If Z=0
:det(12,GREEN,WHITE
:If Z=1
:det(12,GREEN,LTGRAY
:If Z=2
:det(12,GREEN,MEDGRAY
:If Z=3
:det(12,GREEN,GRAY
:If Z=4
:det(12,GREEN,DARKGRAY
:If Z=5
:det(12,GREEN,BLACK
:If C≥10
:Then
:Output(A,B,"θ"
:Else
:Output(A,B,int(C
:End
:For(E,1,F
:If ∟LEVEL(E)=0
:det(12,RED,WHITE
:If ∟LEVEL(E)=1
:det(12,RED,LTGRAY
:If ∟LEVEL(E)=2
:det(12,RED,MEDGRAY
:If ∟LEVEL(E)=3
:det(12,RED,GRAY
:If ∟LEVEL(E)=4
:det(12,RED,DARKGRAY
:If ∟LEVEL(E)=5
:det(12,RED,BLACK
:If ∟LIVES(E)≥10
:Then
:Output(∟YAXIS(E),∟XAXIS(E),"θ"
:Else
:Output(∟YAXIS(E),∟XAXIS(E),int(∟LIVES(E
:End
:End
:Else
:If D=23
:Then
:ClrHome
:Disp " Pickaxe Speed Uses Cost"
:Disp "1:Gold 5 10 10"
:Disp "2:Wood 2 20 10"
:Disp "3:Stone 3 30 20"
:Disp "4:Iron 4 40 30"
:Disp "5:Diamond 5 50 40"
:Disp " INVENTORY"
:Output(10,3,"Hand 1 --"
:Output(10,23,G
:If P≠0
:Then
:Output(8,3,sub(Str1,7P-6,7
:If P=1
:Output(8,13,"5"
:If P≥2
:Output(8,13,P
:Output(8,18,N
:End
:If Q≠0
:Then
:Output(9,3,sub(Str1,7Q-6,7
:If Q=1
:Output(9,13,"5"
:If Q≥2
:Output(9,13,Q
:Output(9,18,10Q
:End
:Repeat D≠0
:getKey→D
:End
:If Q=0
:Then
:If P≠0
:Then
:If D=92 and G≥10
:1→Q
:If D=93 and G≥10
:2→Q
:If D=94 and G≥20
:3→Q
:If D=82 and G≥30
:4→Q
:If D=83 and G≥40
:5→Q
:End
:If P=0
:Then
:If D=92 and G≥10
:1→P
:If D=93 and G≥10
:2→P
:If D=94 and G≥20
:3→P
:If D=82 and G≥30
:4→P
:If D=83 and G≥40
:5→P
:10P→N
:End
:If D=92 and G≥10
:G-10→G
:If D=93 and G≥10
:G-10→G
:If D=94 and G≥20
:G-20→G
:If D=82 and G≥30
:G-30→G
:If D=83 and G≥40
:G-40→G
:End
:ClrHome
:For(S,1,dim(∟WALL
:If ∟WALL(S)≠0
:Then
:int(∟WALL(S)/100)→T
:∟WALL(S)-T*100→U
:sum(T*100+U=∟WALL→R
:If R=5
:det(12,BLACK,BLACK
:If R=4
:det(12,DARKGRAY,DARKGRAY
:If R=3
:det(12,GRAY,GRAY
:If R=2
:det(12,MEDGRAY,MEDGRAY
:If R=1
:det(12,LTGRAY,LTGRAY
:Output(T,U," "
:End
:End
:If Z=0
:det(12,GREEN,WHITE
:If Z=1
:det(12,GREEN,LTGRAY
:If Z=2
:det(12,GREEN,MEDGRAY
:If Z=3
:det(12,GREEN,GRAY
:If Z=4
:det(12,GREEN,DARKGRAY
:If Z=5
:det(12,GREEN,BLACK
:If C≥10
:Then
:Output(A,B,"θ"
:Else
:Output(A,B,int(C
:End
:For(E,1,F
:If ∟LEVEL(E)=0
:det(12,RED,WHITE
:If ∟LEVEL(E)=1
:det(12,RED,LTGRAY
:If ∟LEVEL(E)=2
:det(12,RED,MEDGRAY
:If ∟LEVEL(E)=3
:det(12,RED,GRAY
:If ∟LEVEL(E)=4
:det(12,RED,DARKGRAY
:If ∟LEVEL(E)=5
:det(12,RED,BLACK
:If ∟LIVES(E)≥10
:Then
:Output(∟YAXIS(E),∟XAXIS(E),"θ"
:Else
:Output(∟YAXIS(E),∟XAXIS(E),int(∟LIVES(E
:End
:End
:Else
:A→I
:B→J
:Z→θ
:If D=25 or D=22
:A-1→A
:If D=26 or D=33
:B+1→B
:If D=34 or D=42
:A+1→A
:If D=24 or D=31
:B-1→B
:If A=0
:1→A
:If A=11
:10→A
:If B=0
:1→B
:If B=27
:26→B
:If D≠22 and D≠33 and D≠42 and D≠31
:Then
:For(E,1,F
:If A=∟YAXIS(E) and B=∟XAXIS(E)
:Then
:If Z=∟LEVEL(E
:Then
:If W=0
:0.1→V
:If W=1
:0.2→V
:If W≥2
:W/10→V
:∟LIVES(E)-V→∟LIVES(E
:Y-1→Y
:If Y=0
:Then
:X→W
:0→X
:10W→Y
:End
:End
:If Z≥∟LEVEL(E
:Then
:I→A
:J→B
:End
:End
:End
:If D=32 and Z≤4 and G≥1
:Then
:A*100+B→∟WALL(max(seq(S(0=∟WALL(S)),S,1,dim(∟WALL)
:G-1→G
:Z+1→Z
:Else
:If sum(A*100+B=∟WALL)<Z
:sum(A*100+B=∟WALL)→Z
:End
:If sum(A*100+B=∟WALL)>Z
:Then
:If P=0
:1→V
:If P=1
:5→V
:If P≥2
:P→V
:For(M,1,V
:If sum(A*100+B=∟WALL)>Z
:Then
:If N≠0 or P=0
:Then
:0→∟WALL(max(seq(S(A*100+B=∟WALL(S)),S,1,dim(∟WALL)
:sum(A*100+B=∟WALL→R
:If R=4
:det(12,RED,DARKGRAY
:If R=3
:det(12,RED,GRAY
:If R=2
:det(12,RED,MEDGRAY
:If R=1
:det(12,RED,LTGRAY
:If R=0
:det(12,RED,WHITE
:For(E,1,F
:If A*100+B=∟ENEMY(E
:Then
:If ∟LIVES(E)≥10
:Then
:Output(A,B,"θ"
:Else
:Output(A,B,int(∟LIVES(E
:End
:∟LEVEL(E)-1→∟LEVEL(E
:End
:End
:If max(A*100+B=∟ENEMY)=0
:Output(A,B," "
:G+1→G
:N-1→N
:End
:End
:End
:If N=0
:Then
:Q→P
:0→Q
:10Q→N
:End
:I→A
:J→B
:End
:If C<10 and randInt(0,2)=2
:C+0.05→C
:If Z=0
:det(12,GREEN,WHITE
:If Z=1
:det(12,GREEN,LTGRAY
:If Z=2
:det(12,GREEN,MEDGRAY
:If Z=3
:det(12,GREEN,GRAY
:If Z=4
:det(12,GREEN,DARKGRAY
:If Z=5
:det(12,GREEN,BLACK
:If C≥10
:Then
:Output(A,B,"θ"
:Else
:Output(A,B,int(C
:End
:If A≠I or B≠J
:Then
:If θ=0
:det(12,WHITE,WHITE
:If θ=1
:det(12,LTGRAY,LTGRAY
:If θ=2
:det(12,MEDGRAY,MEDGRAY
:If θ=3
:det(12,GRAY,GRAY
:If θ=4
:det(12,DARKGRAY,DARKGRAY
:If θ=5
:det(12,BLACK,BLACK
:Output(I,J," "
:End
:Else
:If G≥1
:Then
:If max(A*100+B=∟ENEMY) or A=I and B=J
:Then
:Else
:sum(A*100+B=∟WALL→R
:If R≤4
:Then
:A*100+B→∟WALL(max(seq(S(0=∟WALL(S)),S,1,dim(∟WALL)
:If R=4
:det(12,BLACK,BLACK
:If R=3
:det(12,DARKGRAY,DARKGRAY
:If R=2
:det(12,GRAY,GRAY
:If R=1
:det(12,MEDGRAY,MEDGRAY
:If R=0
:det(12,LTGRAY,LTGRAY
:Output(A,B," "
:G-1→G
:End
:End
:End
:I→A
:J→B
:End
:End
:End
:For(E,1,F
:If ∟LIVES(E)=0
:Then
:If ∟ENEMY(E)≠0
:Then
:Output(∟YAXIS(E),∟XAXIS(E)," "
:0→∟YAXIS(E
:0→∟XAXIS(E
:0→∟ENEMY(E
:End
:Else
:∟YAXIS(E→K
:∟XAXIS(E→L
:∟LEVEL(E→θ
:randInt(1,8)→H
:If H=1
:K+1→K
:If H=2
:K-1→K
:If H=3
:L+1→L
:If H=4
:L-1→L
:If H=5
:Then
:If K<A
:K+1→K
:If K>A
:K-1→K
:End
:If H=6
:Then
:If L<B
:L+1→L
:If L>B
:L-1→L
:End
:If K=0
:1→K
:If K=11
:10→K
:If L=0
:1→L
:If L=27
:26→L
:If sum(K*100+L=∟WALL)>∟LEVEL(E
:Then
:If randInt(0,1)=1 and ∟LEVEL(E)≤4 and ∟BLOCK(E)≥1
:Then
:∟ENEMY(E)→∟WALL(max(seq(S(0=∟WALL(S)),S,1,dim(∟WALL)
:∟BLOCK(E)-1→∟BLOCK(E
:∟LEVEL(E)+1→∟LEVEL(E
:Else
:0→∟WALL(max(seq(S(K*100+L=∟WALL(S)),S,1,dim(∟WALL)
:sum(K*100+L=∟WALL→R
:If R=4
:det(12,GREEN,DARKGRAY
:If R=3
:det(12,GREEN,GRAY
:If R=2
:det(12,GREEN,MEDGRAY
:If R=1
:det(12,GREEN,LTGRAY
:If R=0
:det(12,GREEN,WHITE
:If A=K and B=L
:Then
:If C≥10
:Then
:Output(K,L,"θ"
:Else
:Output(K,L,int(C
:End
:Z-1→Z
:Else
:If max(K*100+L=∟ENEMY
:Then
:If R=4
:det(12,RED,DARKGRAY
:If R=3
:det(12,RED,GRAY
:If R=2
:det(12,RED,MEDGRAY
:If R=1
:det(12,RED,LTGRAY
:If R=0
:det(12,RED,WHITE
:For(R,1,F
:If K=∟YAXIS(R) and L=∟XAXIS(R)
:Then
:If ∟LIVES(R)≥10
:Then
:Output(K,L,"θ"
:Else
:Output(K,L,int(∟LIVES(R
:End
:End
:End
:Else
:Output(K,L," "
:End
:End
:∟BLOCK(E)+1→∟BLOCK(E
:End
:∟YAXIS(E→K
:∟XAXIS(E→L
:End
:If A=K and B=L
:Then
:If ∟LEVEL(E)=Z
:C-0.25→C
:∟YAXIS(E→K
:∟XAXIS(E→L
:End
:If max(K*100+L=∟ENEMY
:Then
:∟YAXIS(E→K
:∟XAXIS(E→L
:End
:If sum(K*100+L=∟WALL)<∟LEVEL(E
:sum(K*100+L=∟WALL)→∟LEVEL(E
:If ∟LIVES(E)<10 and randInt(0,2)=2
:∟LIVES(E)+0.05→∟LIVES(E
:If ∟LEVEL(E)=0
:det(12,RED,WHITE
:If ∟LEVEL(E)=1
:det(12,RED,LTGRAY
:If ∟LEVEL(E)=2
:det(12,RED,MEDGRAY
:If ∟LEVEL(E)=3
:det(12,RED,GRAY
:If ∟LEVEL(E)=4
:det(12,RED,DARKGRAY
:If ∟LEVEL(E)=5
:det(12,RED,BLACK
:If ∟LIVES(E)≥10
:Then
:Output(K,L,"θ"
:Else
:Output(K,L,int(∟LIVES(E
:End
:If θ=0
:det(12,WHITE,WHITE
:If θ=1
:det(12,LTGRAY,LTGRAY
:If θ=2
:det(12,MEDGRAY,MEDGRAY
:If θ=3
:det(12,GRAY,GRAY
:If θ=4
:det(12,DARKGRAY,DARKGRAY
:If θ=5
:det(12,BLACK,BLACK
:If K≠∟YAXIS(E) or L≠∟XAXIS(E
:Output(∟YAXIS(E),∟XAXIS(E)," "
:K→∟YAXIS(E
:L→∟XAXIS(E
:K*100+L→∟ENEMY(E
:End
:End
:End
:ClrHome
:det(12,300
:If C≤0
:Disp "You Lose!"
:If max(∟LIVES)≤0
:Disp "You Win!
:If D≠45
:Then
:Pause
:ClrHome
:End
:DelVar ∟WALLDelVar ∟YAXISDelVar ∟XAXISDelVar ∟LIVESDelVar ∟ENEMYDelVar ∟BLOCKDelVar ∟LEVELDelVar Str1DelVar ADelVar BDelVar CDelVar DDelVar EDelVar FDelVar GDelVar HDelVar IDelVar JDelVar KDelVar LDelVar MDelVar NDelVar ODelVar PDelVar QDelVar RDelVar SDelVar TDelVar UDelVar VDelVar WDelVar XDelVar YDelVar ZDelVar θ
Also, what do you think of the name? The first name was Arena Craft, it is now PvP Craft, and assemblybandit suggested Kill Craft in the contest forum.
Here is the beta. I've made no changes on it since the submission to the contest.
http://download1321.mediafire.com/8epiahq866qg/hpcbfgxrhrykpcv/PVPCRAFT.8xp