Zania week 6: Bullets

Completed

Continuation from Ship last week, I traced the bullet destruction problem into weaponID.

  • Another new bug, the GUI is not tracking the player constantly, but at an interval. Raising the priority of the GUI as the next task. Fixed after fixing the bug below. Related to sprite ordering.
  • A new bug, probably from earlier fixes. Bitmap data for ships are not tracking their physical bodies.
    • In the previous codes, userData follows only one of the compound physical body instead of the actual compound physical body, thus the inability to track.
    • Above not working. Where does userData position gets updated?
    • Very confused now. Flash is supposed to take care of the Sprite attachments.
    • YES! Turns out that it’s because I declared the graphics after the body gets created by the singleton in SolarSystem. Now I create the body before the singleton. Somehow this fixes the AI’s graphics as well. Investigating…
    • Right, because AI and Player both calls Ship to create the graphics.
  • Bullet class rewritten with m_body Destructor in mind
  • Debug draw shows physics body is destroyed properly, but discovered that the graphics Data did not get Destroyed()
    • Fixed. added m_sprite.removeChild(m_body.m_userData) in actor destructor before body is nullified. Removing the last reference to the graphic.
  • Commenced implementing player health system. This looks like it’s going to be a long process.
    • Made graphics semi transparent when DEBUG::DRAW is on.
    • Added b2ContactListener
    • Enabled Contact listening in SolarSystem
    • Listener logic:
      • if (m_body1.IsBullet() || m_body2.IsBullet()){
        if (m_body1.m_actor.m_ship) m_body1.m_actor.m_ship.Damage(m_body2.m_actor.m_bullet.damage);
        if (m_body2.m_actor.m_ship) m_body2.m_actor.m_ship.Damage(m_body1.m_actor.m_bullet.damage);
        }
      • Wonder if I can use an xor gate.
    • m_ship is not assigned to its respective actors with the newer constructor2, therefore ship detection of an aggregator is impossible.
    • Wrong assertion above. It turns out that bullet did not get any actor assigned. Investigating bullet creation. Bullet creation did not reference m_actor.
    • Adding scanning condition to detect HP. Preliminary location should be within Update, but not sure.
    • Done implementing health, Actor destruction not done and Collision with SUN causes crashes. SUN is not a destructible ship. and no condition to catch that.
    • The SUN problem is because the initiation did not assign an actor to as the aggregator. Same problem with all other class I believe.
    • So the destruction when health goes below 0 worked on AI, but it doesn’t work on player… ???!?!?
    • Player did not follow the traditional route of CreateActor so it was not part of the linked list.
    • WOOT! Small milestone reached. Rest!

Incomplete

  • Attempt conversion to CS5 failed.
  • Determine which class should be the one retaining weapon ID
    • Actor? Ship? Player? AI?

Steps to first milestone May 1st

  • One player ship and one ai ship artwork finished along with their xml data (Art + some programming)
  • Hitpoints, body existence timer and actor destruction (Hardcore Programming)
  • One planet orbiting the sun. (Hardcore Programming)
  • GUI placement (Art + menial Programming)
  • Booster animation (Art + Math + some programming)
  • Populated galaxy (menial programming)
  • Dynamic graphics loader for background? (Cleverness)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>