snek
snek copied to clipboard
Make makeBomb(x,y) accept absolute pixel values, not grid position
This makes it more versatile and then it doesn't have to care about how bit the grid sections are. Should be the case for all particle generating.
We could pass an x/y grid coordinate with optional px/py pixel offset inside that grid rectangle?
Yeah, but I think the particle thing has use beyond our game so makes sense to make it less dependent on knowing some kind of grid and offset.
I think also if you pass in an x,y with a width of 50 or 100 - it should just do the offset calculations to center it on x/y by itself. This assumes equal width/height for particles, but that will be the general case I think.
+1 for centering. We can make a little layer between the game logic and the particles library so that when you call makeParticles(x,y)
or something it autoconverts and calls particles.makeParticles(x-in-pixels, y-in-pixels)
, so that the game logic can keep using grid coordinates but the particle library only has to deal with pixel values
Yeah sounds good to me. Eventually I'd like to release/offer the particle maker as a standalone thing, so that will be useful. We can make some kinda getPixelsFromGridCoords(x,y) type of function.