PackageCom.swift;ImportCom.rupeng.game.GameCore; Public classBouncingballImplementsRunnable { Public Static voidMain (string[] args) {Gamecore.start (NewBouncingball ()); } @Override Public voidrun () {gamecore.setgamesize (1024, 500); Gamecore.setgametitle ("Gravity Pinball"); Gamecore.createsprite (0, "Ball1"); Gamecore.playspriteanimate (0, "rotate",true); Gamecore.setspriteposition (0, 200, 1); Doubley = 0; Doubleg = 9.8; intt = 1; Doublev = 0; intFlag = 0; for (;;) { if(flag = = 0) {v= v + G *T; Y= y + V *T; } System.out.println (T+ "" + V + "" +y); if(Y >= 450) {flag= 1; } System.out.println (Flag= = 1); if(Flag = = 1) {v= V-g *T; System.out.println (v); Y= Y-v *T; } if(V < 0) {flag= 0; } if(v < 0 && y > 450) { Break; } gamecore.setspriteposition (0, 200, (int) y); Gamecore.pause (200); } gamecore.setspriteposition (0, 200, 450); Gamecore.pause (5000); }}
Java animation Gravity Pinball such as the ROC Game Engine wizard design a small ball to accelerate the landing and slow up and repeatedly until the end of the Java program