Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Yeah
#1
Maybe you don't remember me but after a long stop, i'm back again. And i discover Free BAsic. It's amazing.
So I want to make a game which be like Tyrian ( it 's a shoot Them Up )
It's a serious project and i've already shown waht i can do in basic.
So i began this night and just try to make a good engine.
If you don't remember me or if you don't know me have a look
http://biskbart.free.fr/nouveau/eprog.htm
For this project, i need a good pixel artist ( really good ).
Code:
Declare Sub ShowMap(X%,Y%)

' Set 320x240 mode
SCREEN 14, 16

Const TileSize% = 16, MaxTile% = 10
Const MaxTileSet% = 3
Const MapX% = 32, MapY% = 130

DIM Shared TileSet(0 To MaxTile%,0 To TileSize% * TileSize% + 4) As UShort
Dim Shared Map(0 To MapX%,0 To MapY%) As UShort
' Create Map
For J%=0 To MapY%
For I%=0 To MapX%
   Map(I%,J%)=Int(RND * 4)
Next I%
Next J%
' Create TileSet
Compteur = 2
For J%=0 To TileSize%-1
For I%=0 To TileSize%-1
     TileSet(0,Compteur)=I% And J%
     TileSet(1,Compteur)=I% Xor J%
     TileSet(2,Compteur)=I% + J%
     Compteur = Compteur + 1
Next I%
Next J%
TileSet(0,0)=16 Shl 3
TileSet(0,1)=16
TileSet(1,0)=16 Shl 3
TileSet(1,1)=16
TileSet(2,0)=16 Shl 3
TileSet(2,1)=16
' Draw Map
ShowMap 5,5
Do
A$=Inkey$
B$=""
MAJ%=0
If Len(A$)>1 Then B$=Right$( A$, 1 )
ExDir%=Dire%
Dire%=0
'Ac%=1
If Asc(B$)=77 Then X%=X%-Ac%:MAJ%=1:Dire%=1
If Asc(B$)=75 Then X%=X%+Ac%:MAJ%=1:Dire%=2
If Asc(B$)=72 Then Y%=Y%+Ac%:MAJ%=1:Dire%=3
If Asc(B$)=80 Then Y%=Y%-Ac%:MAJ%=1:Dire%=4
If Dire%=ExDir% And Dire%<>0 Then
     Cpt%=Cpt%+1
    Else
     Cpt%=0
     Ac%=1
End If
If Cpt%=10 Then Ac%=Ac%+1:Cpt%=0
If Maj%=1 Then ShowMap X%,Y%
Maj%=0
Locate 1,1
Print X%,Y%,Ac%
Loop Until A$=Chr$(27)

Sub ShowMap(X%,Y%)
CLS
For J%=Int(Y%\16) To Int(Y%\16)+18
For I%=Int(X%\16) To Int(X%\16)+20
  Put (I% * 16-X%, J% * 16-Y%),TileSet(Map(I%,J%),0),Pset
Next I%
Next J%
End Sub
It took me 10 minutes to code. That"s prove that's Freebasic is like Qbasic but it's better . Thx Victor.
So I you want to help you, you're welcome
Cheers
Biskbart
iskbart
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)