public void UpdateSpriteArray() { if (sprite_name != null) { sprite_array = SpriteArray.GetSpriteArray(sprite_name, sprite_color); } }
public Shoot(ref World world, Weapon weapon, PointF location, float direction, float speed = -1) : base(ref world) { this.time_to_live = (int)(weapon.stats.range / weapon.stats.celerity); this.Team = weapon.ship.team; this.power = weapon.stats.power / weapon.stats.sub_ammos * weapon.ship.team.damage_multiplicator; this.emp_power = weapon.stats.emp_power / weapon.stats.sub_ammos * weapon.ship.team.damage_multiplicator; this.special = weapon.stats.special; this.type = weapon.stats.sprite; this.location = location; this.direction = direction; if (speed == -1) { this.speed_vec = Helpers.GetNewPoint(new Point(0, 0), direction, weapon.stats.celerity); } else { this.speed_vec = Helpers.GetNewPoint(new Point(0, 0), direction, speed); } this.emissive_mode = weapon.stats.emissive_mode; this.emissive_sprite = weapon.stats.emissive_sprite; // UpdateSector(); // useless in practice this.sprites = SpriteArray.GetSpriteArray(this.type, this.Team.color); if (sprite_y == -1) { this.sprite_y = Helpers.rand.Next(0, sprites.count_y); } }
private void SetSpriteArray() { this.sprites = SpriteArray.GetSpriteArray(type); this.sprite_y %= sprites.count_y; if (time_to_live == -1) { time_to_live = sprites.count_x; } }
public void SetSprite(string sprite) { this.sprite = sprite; var try_bmp = SpriteArray.GetSpriteArray(this.sprite).GetSprite(0, 0); if (try_bmp is object) { width = try_bmp.Width; level = (int)Math.Sqrt(width) / 2; integrity = (int)(width * width / 12d); if (width >= 25) { repair = 1; } cost.Metal = width * 2 + level * 10; if (width >= 20) { cost.Crystal = 1L; } } }
public static Bitmap GetSprite(string img_name, int x, int y, Color Scolor = default) { SpriteArray sa = SpriteArray.GetSpriteArray(img_name, Scolor); return(sa.GetSprite(x, y)); }