VBGamer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
Re: Topview RPG help Lorn (2 replies, 0 views) (2001-Mar-7) It's kinda easy so listen up!
First I would presume that you have your map created like this:
Type tl
X as Integer 'X of tile
Y as Integer 'Y of tile
Texture as String 'Texture of tile
Passable as Boolean 'Is it walkable?
End type
Public Tile(1000) as tl
Then you want in your main loop something that looks like this:
Sub MainLoop()
... 'Other code like displaying map
Select case KB 'Check keyboard
Case (1) 'They move
Call CheckWalk(Player.X, Player.Y) 'Call the CheckWalk sub that contains code tha looks like this:
Sub CheckWalk( X as Integer, Y as Integer) as Boolean
For i= 0 to tic '0 to tile count
If Tile(i).X = X AND Tile(i).Y = Y then
CheckWalk = False 'NO DONT LET THEM WALK!
Else
CheckWalk = True 'Let them walk
End if
End sub
I guess you can add other things like Item on the tiles but since I am creating a 3D flight game not an RPG, I guess I shouldn't talk too much :)
I hope that helps,
Lorn
|