Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (Mark.GetGlobalBounds().Intersects(Ball.GetGlobalBounds()))
- {
- if (Keyboard.IsKeyPressed(Keyboard.Key.W))
- {
- Ball.Position = new Vector2f(Mark.Position.X, Mark.Position.Y);
- }
- if (Keyboard.IsKeyPressed(Keyboard.Key.A))
- {
- if (Mark.Position.X > Ball.Position.X - 50 && Mark.Position.X < Ball.Position.X + 50)
- {
- //Ball go along with the player
- Ball.Position = new Vector2f(Mark.Position.X, Mark.Position.Y);
- }
- }
- if (Keyboard.IsKeyPressed(Keyboard.Key.S))
- {
- if (Mark.Position.Y > Ball.Position.Y - 50 && Mark.Position.Y < Ball.Position.Y + 50)
- {
- //Ball go along with the player
- Ball.Position = new Vector2f(Mark.Position.X, Mark.Position.Y);
- Dictionary<string, Sprite> myDictionary = new Dictionary<string, Sprite>();
- }
- }
- if (Keyboard.IsKeyPressed(Keyboard.Key.D))
- {
- if (Mark.Position.Y > Ball.Position.Y - 50 && Mark.Position.Y < Ball.Position.Y + 50)
- {
- //Ball go along with the player
- Ball.Position = new Vector2f(Mark.Position.X, Mark.Position.Y);
- }
- }
- //the same with the A, S and D
- } // I don't know if is Global or Local
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement