If(getX()>=getWorld().getWidth()-getImage(). * the 'Act' or 'Run' button gets pressed in the environment. * Act - do whatever the bola wants to do. Assuming the variables in question are declared static, all you need do is put the class name first (before the variable names) on the right side of the 3 lines. Paddle 2 must move by itself while tracking the Ball. The Paddle must move up and down with the User controlling the mouse. Ball must move by itself and bounce off the walls and the Paddles. Create subclass Actors from 'Sprite': Paddle Ball Paddle2 3. * Write a description of class bola here. Create a Greenfoot world with a 500x400 grid with size of 1 px. I think the that the if-statement give the problem. But i dont know why the top wall dont bounce the ball. rd grade includes the use of Greenfoot for the learning of more advanced. greenfoot making wall for ping pong game Ask Question Asked 8 years, 5 months ago Modified 8 years, 5 months ago Viewed 746 times 0 Hi iam making a ping pong game in greenfoot. Masukkan juga kode di bawah ini pada class bola agar bola dapat bergerak dan memantul pada dinding reate the classic ping pong game where the player tries to repel the ball. Create a new world with 600x400 cells with a cell size of 1x1 pixels. Masukkan kode di bawah pada class bg (nama subclass world) Langsung saja lihat tutorialnya di bawah.īuat class World baru dengan cara klik kanan>new subclass>masukkan nama class, begitu juga dengan class actor caranya sama. Sang pemain mengerakan sebuah bat yang bergerak naik-turun, permainan ini dapat dimainkan dengan komputer atau dua orang yang mengerakan bat di sebelah kiri. Tutorial Greenfoot kali ini saya akan membuat game pingpong, artikel sebelumnya saya juga membuat tutorial game pesawat jia kalian ingin membaca artikel tersebut kunjungi link ini. Permainan Pong adalah permainan video olahraga dua dimensi yang men simulasikan sebuah permainan tenis meja.
0 Comments
Leave a Reply. |