//---------------------------------------------------------------- // Constructor //---------------------------------------------------------------- // internal Ninja() : this(name: "Ninja") { m_speed_trail = new PhotonTrailQueue( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.trail ), Vector2.Zero ); m_sonicboom = new SonicBoom( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.sonic_boom ) ); }
public Ninja( float throw_power = NINJA_THROW_POWER, float move_force = NINJA_FORCE, float maxspeed = NINJA_MAXSPEED, int capacity = NINJA_MAXTHROWABLE_CAPACITY, String name = "Ninja", String texture_name = TNames.ninja_animate, float boost = 50 ) { m_throw_power = throw_power; m_movement_accel = move_force; m_maxspeed = maxspeed; m_max_throwable_capacity = capacity; throwable_objects = m_throwing_items; m_boost_amt = boost; m_cruise_cooldown = 255; m_has_item = m_throwing_items.Count > 0; m_facing_angle = (float)Math.PI / 2; m_picking_up = true; m_speed_trail = new PhotonTrailQueue( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.trail ), Vector2.Zero ); m_sonicboom = new SonicBoom( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.sonic_boom ) ); }
// The Ninja Constructor // <param name="world"> The World this object would be contained // inside </param> // <param name="texture"> The image that governs the shape of this // object</param> // <param name="velocity"> The initial velocity from throwing</param> // <param name="density"> The object's mass per unit area </param> // <param name="friction"> Usually set to 0 for throwable objects, // but sliding factor </param> // <param name="restitution"> Bounciness </param> public Ninja( GameWorld world, Texture2D texture, Vector2 position, float radius, float throw_power = NINJA_THROW_POWER, float move_force = NINJA_FORCE, float maxspeed = NINJA_MAXSPEED, int capacity = NINJA_MAXTHROWABLE_CAPACITY, String name = "Ninja", String texture_name = TNames.ninja_animate, float boost = 50 ) : base(world, texture, NINJA_DENSITY, NINJA_FRICTION, NINJA_RESTITUTION, name: name, texture_name: texture_name) { m_throw_power = throw_power; m_movement_accel = move_force; m_maxspeed = maxspeed; m_max_throwable_capacity = capacity; throwable_objects = m_throwing_items; m_boost_amt = boost; m_buffered_position = position; m_radius = radius * NINJA_SIZE_SCALE; m_has_item = m_throwing_items.Count > 0; m_facing_angle = (float)Math.PI / 2; m_picking_up = true; m_cruise_cooldown = 255; m_speed_trail = new PhotonTrailQueue( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.trail ), position ); m_sonicboom = new SonicBoom( GameScreen.GAME_CONTENT.Load<Texture2D>( TNames.sonic_boom ) ); }