on the example of the video, there are 5 maps, each one with 32 tiles width and 28 tiles height. there are some bugs when drawing the scenario and with some collisions. also, you can notice that there are the variables: - xR (real x position in tiles - see it can go up to 157 tiles) - x (x position over each map, from 0 to 31 - as each map has 32 tiles widht) - y (y position) - mapa (showing in which map the character is)
it is possible to apply this technique to any game.
in theory, the scenario can go up to 32600 pixels widht. I say 32600 pixels because of the limitation with positive numbers in BEX.
if the community wants it, I can share the BEX code.
Last Edit: Jan 11, 2018 14:54:54 GMT -5 by nemezes
now I can handle collisions using a big map on the castlevania example..
in theory it can go up to almost 32600 pixels width.
It loads maps of 32 tiles width. in my example it has 4 maps of 32 tiles, total 4*32 = 128 tiles = 1024 pixels width.
but, doing this way it has some problems when drawing the maps (using drawtiles) and there is a collision problem when walking right when reaching the end of a map, I do not know how to correct but there is a simple level design way to avoid it (do not put walls on the first columns and on the last columns add 1 tile in height in comparison with the tiles in the first columns).
mapExampleToAvoidProblems: '0=empty , 1=collision as the castlevania example by moon
if the comunity want it, I can share here with an attachment..
Last Edit: Jan 11, 2018 15:04:23 GMT -5 by nemezes
Thank you. The game is 100% complete now. Expect news soon.
really nice game.. I played a little bit, but it is hard to manage the controls and to avoid enemies properly.
and every time when I walk a lot throw the scnario and get hit, I went baaaaaack to the save point. would you consider to add some kind of life? if the player get hit, it will lost some life and stays at the same place.. lets say the player can get hit 3 times before go back to the save point.
could you tell how did you manage to do a big scenario? do not need to post the code, but just the theory behind it.
There's a lot of methods for doing this, but it really all depends on what your engine needs as well.
The first thing you'll need to do is convert your sprite coordinates to tile coordinates. Let's assume it's an 8x8 pixel sprite: sprx = (spriteposx(MySprite) - 128) / 8 spry = (spriteposy(MySprite) - 128) / 8
(you can substitute >> 3 in place of /8)
Then, what you can do is reload your tile map and use the coordinates as your offset
The y_move would be -1 if you're going up, +1 if you're going down, and 0 if you're not moving in the Y direction The x_move would be -1 if going left, +1 if going right, and 0 if not moving on the X axis
Now, why the ReadInt z?
What I do is assign a number range for my tiles (to keep it simple) to note which ones are walkable/passable and which ones aren't passable. For example, tiles 1 to 50 are walkable tiles (grass, regular ground, etc), and everything else is impassable.
Next, I do something along the lines of:
If z > 0 And z < 51 Then ' move my sprite routine End If
I was trying to understand what was that shift left right in binary.. Now I figure out what it is.. so simple