Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Engine;
- using System.Windows.Forms;
- namespace Colision
- {
- class Class1 : GameObject
- {
- //Initialize function
- public SmallBall()
- : base("Rect1", 128, 64, "RectHorizontal.png")
- {
- }
- public override void Update()
- {
- //Call base update
- base.Update();
- //press up arrow, move object up
- if (InputManager.IsPressed(Keys.Up))
- {
- Position.Y += 3;
- }
- if (InputManager.IsPressed(Keys.Down))
- {
- Position.Y -=3;
- }
- if (InputManager.IsPressed(Keys.Left))
- {
- Position.X += 3;
- }
- if (InputManager.IsPressed(Keys.Right))
- {
- Position.X -= 3;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement