Java Midp 2.0 Touch Screen Games -
protected void pointerPressed(int x, int y) if (y > getHeight() - 50) // Bottom 50px of screen is the "Fire" zone fireWeapon(); else if (x < getWidth() / 2) playerX -= 10; else playerX += 10;
}
// Need: com.nokia.mid.ui.TouchEvent import com.nokia.mid.ui.TouchEvent; import com.nokia.mid.ui.TouchDevice; java midp 2.0 touch screen games
: Triggered continuously as the user moves their finger while maintaining contact. This is used for movement or scrolling. pointerReleased(int x, int y) protected void pointerPressed(int x, int y) if (y
int dpadCenterX = 40, dpadCenterY = screenHeight - 40; if (Math.hypot(touchX - dpadCenterX, touchY - dpadCenterY) < 35) int dx = touchX - dpadCenterX; int dy = touchY - dpadCenterY; if (Math.abs(dx) > Math.abs(dy)) moveHorizontal(dx); else moveVertical(dy); protected void pointerPressed(int x
Владимир Заруйкин, спасибо за разъяснение. Понял - Тед Бриггс, сначала взлетевший в воздух, потом засосанный в воронку, под водой,...