使用這些變量我將如何去與一個munchie碰撞pacman? 我已經有了運動,它發出的天花板必須被賦予更多的代碼才能解釋我將要做的事情。敵人碰撞檢測
Pacman variables
private Point frameSize = new Point(32, 32); // Pacman image size
private Point currentFrame = new Point(1, 0); // Start frame
private Point sheetSize = new Point(2, 4); // Spritesheet size
private Vector2 pacmanPos; // Pacman position in pixels
private int pacmanSpeed = 8; // Pacman movement speed in pixels
// Game
SpriteBatch spriteBatch;
Texture2D munchie1, munchie2, pacman;
// Sounds
SoundEffect collisionSound;
// Random number generator
Random rand = new Random();
// Total number of munchies
private int noOfMunchies = 5;
Vector2[] munchiePos;
private int munchieSize;
private int[] munchieAnimationCount;
private int timeSinceLastFrame = 0;
private int milliSecondsPerFrame = 500; // 2 Frames Per Second (fps)
好的感謝抱歉互聯網去了謝謝你! –