How do you make the falling snow in AndEngine?



  • Hello! I'm trying to make a falling snow in AndEngine♪ Like, there's some kind of playwright retrofit, but I can't 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;}
    

    One snowflake with an arbitrary initial coordinate of "x" and у=1♪ Now, the question is:

    1. How do you get that snowflake to fall?
    2. How do snowflakes appear with a certain frequency and reach the lower edge of the chamber disappear?


  • Gravity is necessary for the objects on the AndEngine stage. Add it to your annex by expanding Physics Box2D Extension. A detailed example of how to do this is http://findevelop.blogspot.com/2011/12/android-andengine-physics-box2d.html ♪




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2