Thank you all so much for your replies; I was concerned at posting so many questions as my first post, and your answers have been exactly what I was looking for.
I am currently making a ‘runner’ type game, just to learn the platform, and I’ve made a manually-scrolling landscape generator that has hills and valleys and blank spots to represent holes to fall into. The decision to go manual - and even to forgo the physics/velocity systems - was based around the small size of the tile maps I could generate, and that when I tried to set vx on the landscape sprite columns the physics time calculations/on game update calls are obviously not sync’ed so I got single-pixel gaps in between the landscape as it moved.
I did see that I could make a tile map manually by using the image template in ‘JavaScript’ (I don’t know why it’s called that, when it’s clearly not actual JavaScript :-p), but I didn’t know if I could make a 100x8px map just to hold the landscape, hence these questions. I assume you don’t offer the ability to enter the tile map dimensions to the coder in order to keep it simple and explain the concept of a tile map easier, but I do wish the JavaScript->Block decompiler would be able to recognise these custom sizes.
The sprite collisions seem like the best of both worlds, I’m very impressed. (I’m impressed with the general quality of this whole system, in fact. I’ve had a long career as a programmer, [I was on the team that wrote Microsoft Windows, for example], and it’s great to see that you guys didn’t just take the easy way out and use pythagoras for collision detection).
I was asking about multiple tile maps partly for RAM usage (I would love to get file IO as an extension) and partly as a workaround for pseudo-infinite runner games with large tile maps (which is now resolved anyway), and partly as a way of having a switch between ‘room maps’ as a section of a level map. So, for example, imagine a rogue-like game where you open a door, and the room content beyond would be in a second tile map. But only one tile map at a time limits that kind of behaviour. No big deal, plenty of ways around that.
I guessed the sprite kind would be an enum or equivalent, and the flags obviously a bitmask, it’s just that those are the only two identifying attributes of a given instance of sprite - you aren’t told what the ID is, so you can’t match up the sprite description with any given instance, and if you can’t tell what kind it is, and can’t interpret the flags, you just can’t debug any issues involving sprites. It would be pretty trivial to display the flags as either hex or binary, I think, but I don’t know how you could show a reference for which bits are which, and the same problem with the Kind.
Finally (sorry for the long post again!), my second question was for my runner game again. If I have a landscape like this:
That is being moved one pixel per game update to the left of the screen, without the user controlling the player sprite, I want it to ‘run’ up the hill and back down again. The animation is no problem, rather it’s the detection of an uphill area in fron of the sprite, and the upward movement. Currently, as I’m doing all this manually, I was getting ready to examine a collision with the player sprite and a tile of Kind Uphill, and start moving the player upwards. But the collision detection is different if I’m not using a tile map, so I’m not clear on how handle that case - and going downhill is worse because of the bounding box on the Downhill tile. I was thinking maybe I have to draw the up and down tiles the same as the flat ones, and just teleport the player sprite up a level, or use gravity (-vy) to drop down; but I also don’t know how to auto-move the whole tile map towards the left, so I haven’t yet been able to experiment with this.
As for suggestions for snapping movement to the tile grid, I think it’s a case of treating the map as being flat or upright; if it’s upright, then the look-ahead collision for climbing up and gravity for dropping down could be implemented either built-in or more likely as a callback of some kind. It’s all I’ve got so far, anyway :-p