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 Microsoft.Xna.Framework;
- namespace Game
- {
- class Dolphin
- {
- private Vector2 _location = new Vector2(50, 200);
- private int _move = 200;
- private int _speed = 5;
- public Vector2 Location
- {
- get { return _location; }
- }
- public void Move(int Height)
- {
- _move = Height;
- }
- public void Update()
- {
- if (Math.Abs(_location.Y - _move) < _speed)
- _location.Y = _move;
- else if (_location.Y < _move)
- _location.Y += _speed;
- else
- _location.Y -= _speed;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement