public override void Render(Screen screen) { if (sprite == null) { sprite = AnimatedSprite.GetAnimatedSprite("m_south_east"); } screen.RenderEntity(Coordinate.NormalToIso(position) / 2, renderBox, sprite.GetSprite()); }
public override void Render(Screen screen) { if (sprite == null) { sprite = AnimatedSprite.GetAnimatedSprite("arrow"); } screen.RenderEntity(Coordinate.NormalToIso(Coordinate.VirtualZAxisReduction(position, -32)) / 2, renderBox, sprite.GetSprite()); }
public void Render(Screen screen) { screen.SetRenderMode(RenderMode.Normal); float x = screen.GetWidth() / 20.0f; float y = screen.GetHeight() * 0.9f; screen.RenderSprite(x - 4, y - 4, HP_Frame, AnimatedSprite.GetAnimatedSprite("hpFrame").GetSprite(), false); screen.RenderSprite(x, y, HP_bar, AnimatedSprite.GetAnimatedSprite("hpBar").GetSprite(), false); x = screen.GetWidth() * 0.9f; y = screen.GetHeight() * 0.85f; screen.RenderText(x, y, player_ammo.ToString(), format); }
void UpdateSprite() { if (previous_direction == direction && prev_moving == moving && prev_attacking == attacking) { return; } else { switch (direction) { case Direction.East: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_east"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_east"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_east"); } break; } case Direction.NorthEast: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_north_east"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_north_east"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_north_east"); } break; } case Direction.North: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_north"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_north"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_north"); } break; } case Direction.NorthWest: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_north_west"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_north_west"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_north_west"); } break; } case Direction.West: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_west"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_west"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_west"); } break; } case Direction.SouthWest: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_south_west"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_south_west"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_south_west"); } break; } case Direction.South: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_south"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_south"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_south"); } break; } case Direction.SouthEast: { if (moving) { sprite = AnimatedSprite.GetAnimatedSprite("mm_south_east"); } else if (attacking) { sprite = AnimatedSprite.GetAnimatedSprite("ma_south_east"); } else { sprite = AnimatedSprite.GetAnimatedSprite("m_south_east"); } break; } } } }