Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Update(GameTime gameTime, Rectangle clientBounds)
- {
- foreach (Blob newBlob in blobList)
- {
- switch (newBlob.direction)
- {
- case 1:
- position.X -= speed;
- break;
- case 2:
- position.X += speed;
- break;
- case 3:
- position.Y -= speed;
- break;
- case 4:
- position.Y += speed;
- break;
- }
- if (newBlob.position.X <= 0)
- {
- speed *= -1;
- }
- if (position.Y <= 0)
- {
- speed *= -1;
- }
- if (position.X > clientBounds.Width)
- {
- speed *= -1;
- }
- if (position.Y > clientBounds.Height)
- {
- speed *= -1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement