rune
Burger Head
Posts: 22
|
Tileset
Nov 9, 2019 18:56:20 GMT -5
Post by rune on Nov 9, 2019 18:56:20 GMT -5
I know it was not well explained. I'm sorry. I will exemplify:
I have a Tileset made in Photshop with 8 tiles. Tileset: 0,1,2,3,4,5,6,7,8
(0=floor, 1=door,2=tree,3=house,4=house,5=house,6=town hall,7=brigde,8=wall) And I want to build a city like this:
8,8,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 8,0,0,0,8,0,0,0,0,8,0,4,0,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,5,0,8 8,0,5,0,8,0,0,0,0,8,0,0,0,8,8,8,0,8,8,0,0,8,0,2,0,8,0,6,6,0,0,0,0,0,8,8,8,0,2,8 8,0,0,0,8,8,0,0,8,8,0,0,0,0,0,0,0,0,8,0,0,8,0,0,0,8,0,6,6,0,0,0,0,0,0,0,8,0,0,8 8,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,7,7,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,8,0,0,8 8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,7,7,8,0,0,0,8,8,8,8,8,8,8,0,0,0,0,8,0,0,8 8,0,2,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 8,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,3,0,0,0,0,0,0,0,5,8 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,1,1,8,8,8
The characters would walk on 0 and 7, but would collide on 1,2,3,4,5,6 and 8
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Nov 12, 2019 16:40:41 GMT -5
I know it was not well explained. I'm sorry. I will exemplify: I have a Tileset made in Photshop with 8 tiles. Tileset: 0,1,2,3,4,5,6,7,8 (0=floor, 1=door,2=tree,3=house,4=house,5=house,6=town hall,7=brigde,8=wall) And I want to build a city like this: 8,8,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 8,0,0,0,8,0,0,0,0,8,0,4,0,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,5,0,8 8,0,5,0,8,0,0,0,0,8,0,0,0,8,8,8,0,8,8,0,0,8,0,2,0,8,0,6,6,0,0,0,0,0,8,8,8,0,2,8 8,0,0,0,8,8,0,0,8,8,0,0,0,0,0,0,0,0,8,0,0,8,0,0,0,8,0,6,6,0,0,0,0,0,0,0,8,0,0,8 8,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,7,7,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,8,0,0,8 8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,7,7,8,0,0,0,8,8,8,8,8,8,8,0,0,0,0,8,0,0,8 8,0,2,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8 8,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,3,0,0,0,0,0,0,0,5,8 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,1,1,8,8,8 The characters would walk on 0 and 7, but would collide on 1,2,3,4,5,6 and 8
You'll need to make a map engine.
You can use Data and DataInt statements for your map. Use the numbers above like so: MyTownMap: DataInt 8,8,1,1,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 DataInt 8,0,0,0,8,0,0,0,0,8,0,4,0,0,0,0,0,0,0,0,0,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,0,5,0,8 DataInt 8,0,5,0,8,0,0,0,0,8,0,0,0,8,8,8,0,8,8,0,0,8,0,2,0,8,0,6,6,0,0,0,0,0,8,8,8,0,2,8 DataInt 8,0,0,0,8,8,0,0,8,8,0,0,0,0,0,0,0,0,8,0,0,8,0,0,0,8,0,6,6,0,0,0,0,0,0,0,8,0,0,8 DataInt 8,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,8,7,7,8,0,0,0,8,0,0,0,0,0,0,0,0,0,0,8,0,0,8 Suppose your 9 tiles are loaded into location 100:
LoadTiles TownTiles,8,100
You have a loop to draw the tiles (the MyTownMap table above isn't a full screen worth of tiles, so you'd want to fill that out first):
Reload MyTownMap For y = 0 to 27 For x = 0 to 39 ReadInt z DrawTile 100+z,x,y Next Next
Then you need to keep track of your sprite's coordinates, then check the map to see if you're about to cross a tile that should block you. If it is one of those tiles, cancel the movement.
If you want to make a scrolling map, you'll need to write the column or row you're about to see prior to scrolling. Search these forums for a soleil example. It has a basic engine you might be able to use.
|
|