I have a tile background and I want to spawn an object only on the tilebackground but in random positions like a random procedural generation. I would also like to set the object to random frame and animation frame. Is this possible?
Develop games in your browser. Powerful, performant & highly capable.
What exactly your question is about? How to keep sprites inside the tiled background? You can use BBox* expressions, for example:
Create Sprite at random(tiledbackground.BBoxLeft, tiledbackground.BBoxRight), random(tiledbackground.BBoxTop, tiledbackground.BBoxBottom) Sprite set animation frame to int(random(Sprite.AnimationFrameCount))
But if you are trying to make a grid map, I suggest using TileMap object instead.