in fact the player "@" cannot go off screen cause it always look like that
HHHHHHHHHHHHHHHH
H................................H
H................................H
H................................H
H................................H
H................................H
H................................H
HHHHHHHHHHHHHHHH
and and you can't go outside cause :
(X and Y are the position on the screen of the "@")
actually the movement routine is complete (i only have to integrate the movement for the ennemy (wich is almost done...)
I have many programs, but now i only need to show you Two of these
Program ROGUE:
Code: Select all
AxesOff:ClrDraw:ClrHome:2->H:2->Y
Output(1,1," Rogue v0.1
Output(3,4,"Loading
Output(4,1,"Generating area
69!:Output(3,11,".
1:prgmROGUEGEN //Map generator program
Output(4,1,"Generating char- //Loaded with funciton "1"
Output(5,1,"acter data
69!:Output(3,12,".
1:prgmROGUECHA //Character generation program
Output(4,1,"Working out mon- //Loaded with function "1"
Output(5,13'".
1:prgmROGUEMON //Monster Generation program
Output(4,1,"Done, press //Loaded with function "1"
Output(5,1,"ENTER to begin
Pause
ClrHome
Repeat 0 //Engine start HERE
Output(1,1,Str0 //The map is stored in Str0
Output(L2(2),L2(1),"k //Display the kobold (monster)
Ouput(Y,X,"@ //Display yourself "@"
Repeat Ans
getkey->K
End
X->A:Y->B
X+(K=26)-(K=24->X
Y+(K=34)-(K=25->Y
X-(X>16)+(X<1->X
Y-(Y>8)-(Y<1->Y
Output(1,1,Str0
If sub(Str0,(16(y-1))+X,1)="H
Then
A->X
B->Y
Output(8,1,"You bumped into
Pause
Output(8,1,"a wall
End
if K=55 and sub(Str0,(16(Y-1))+X,1)="> //This is the stairs :p
Then
L+1->L
L:prgmROGUEGEN //Map generation program
End //with function "L" (level var)
If K=55 and sub(Str0,(16(Y-1))+X,1)="< //This is the stairs :p
Then
L-1->L
L`:prgmROGUEGEN
End
If L>2 //This is only an alpha
Then //don't expect 30 levels :p
ClrHomt
Output(4,7,"Woot!
End
If L<1:Then
ClrHome
Disp "Loser!! you ascended!!!
Pause:ClrHome
Stop
End
2:prgmROGUEMON //AI is loaded HERE after you chose what you will
End //do
And this is the second program ROGUEMON wich is essentially the monster generation things, and IA calculation
Program ROGUEMON :
Code: Select all
If Ans=1:Then
If L=1:{8,6,8,6,3,20,10,2,5,0,0,0,1}->L2 //{8,6,8,6} is the equi-
Return:End //valence of X,Y,A,B in prgmROGUE
If Ans=2:Then
L2(2)-Y->T //L2(2) is in fact the equivalent of the Y
L2(1)-X->U //Same here but for X
If T>1:L2(2)-1->L2(2)
If T<-1:L2(2)+1->L2(2)
If U>1:L2(1)-1->:L2(1)
If U<-1L2(1)+1->L2(1)
If sub(Str0,(16(L2(2)-1))+L2(1),1)!="H
Then
L2(3)->L2(1)
L2(4)->L2(2)
End
L2(1)->L2(3)
L2(2)->L2(4)
Return:End
I know this need many optimisation and i intend to do it, but for now, let's just concentrate on the more complicated task, like the IA wich is BAAAAD now :p
i need your help
![Smile :)](./images/smilies/grayscale_smile.gif)