使用这些变量,我将如何将 pacman 与 munchie 碰撞?我已经有了动作,而且它确实发送的天花板必须得到代码,更像是解释我必须做什么。
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)