Hello! I'm trying to make falling snow in AndEngine
. It seems like there are modifiers for the movement of sprites, but I can not find anything.
public Scene onLoadScene() { Random randomGenerator = new Random(); pX = randomGenerator.nextInt(CAMERA_WIDTH); Sprite snow = new Sprite (pX, 1, 30, 30, mTextureSnowRegion); scene.getLastChild().attachChild(snow); return scene;}
The result is one snowflake with an arbitrary initial coordinate "x" and with у=1
. And now attention to the question:
- How to make this snowflake fall?
- How to make the snowflakes appear with a certain frequency and, reaching the bottom edge of the camera, disappear?