Пример #1
0
 public UpdateEventArgs(GameTime gameTime)
 {
     GameTime = gameTime;
 }
Пример #2
0
 /// <summary>
 /// Draws this GameObject. By default, nothing happens, but other classes can override this method.
 /// </summary>
 /// <param name="gameTime">An object containing information about the time that has passed.</param>
 /// <param name="spriteBatch">The sprite batch to use.</param>
 public virtual void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
 }
Пример #3
0
 public void PublishUpdate(GameTime gameTime)
 {
     if (Update != null)
         Update(this, new UpdateEventArgs(gameTime));
 }
Пример #4
0
 /// <summary>
 /// Updates this GameObject by one frame.
 /// By default, this method updates the object's position according to its velocity.
 /// You can override this method to create your own custom behavior.
 /// </summary>
 /// <param name="gameTime">An object containing information about the time that has passed.</param>
 public virtual void Update(GameTime gameTime)
 {
     LocalPosition += velocity * (float)gameTime.ElapsedGameTime.TotalSeconds;
 }