Joncom
Joncom
Are you sure image preloading actually still works? Looks like you're loading your images after the game is already running, in entity constructors: https://github.com/cdreier/Impact/blob/ab981ec766ff54e25eb320d4c714298a0f2da9b3/game/PlayerEntity.js#L6-L9 There's no reason that image would...
> most of the debug panels are working as expected Which panels are not working as expected? > `.inject` was hard, but i got it working with js proxies Where...
First calculate the position of the player based on his `pos.x`, `pos.y`, size.x`, and `size.y`, and then just add or subtract `1` tile depending if you want left, right, up,...
You could also combine it with checking ig.game.collisionMap.data to see which tiles are passable. In general, a collision tile with value of 0 is passable, while a tile with a...
getTile and setTile work on every kind of map, however note that they take absolute/pixel, not tile, coordinates, and then calculate which tile that is.
An entity on a tile won’t affect the collision map data. Entity collisions are a different thing.
You could loop through the entities array and check if each entity (based on its pos and size) is currently overlapping the tile you’re interested in.
Take a look at the code inside ig.Entity.touches. The premise is the same whether you’re checking for entity vs tile, or entity vs entity. Just pretend the tile is an...
Haven’t had a chance to look at that yet, and it’s been a long time since I played with that plugin so I can’t really suggest much off the top...
If you want the player to get stopped by the NPC, then your player needs to be weaker than the NPC. Perhaps try leaving NPC as FIXED (the strongest), and...