About | Rules and Guide | Sign In/Create Account | Write a Post
Construction1990’s Internet Montage? No!
Please excuse the site weirdness. Mike is fixing and making things.
Ludum Dare 31 — Coming December 5th-8th 2014!

  • ??? Begins: in 9 days, 7 hours, 12 minutes, 31 seconds
  • October Ends: in 10 days, 7 hours, 24 minutes, 31 seconds
  • Ludum Dare 31 begins: in 45 days, 8 hours, 12 minutes, 31 seconds
  • (FYI: Clock might be off) | Ludum Dare 31: Real World Gatherings (Now Open!)

    [ October Challenge 2014 | Resources | Submit/Edit | View All ]


    Lunch #1 and Serious Bug

    Posted by (twitter: @xMrPhil)
    April 21st, 2012 12:04 pm

    Lunch 1
    It’s almost 3 pm here in Arlington, VA and I’m having my first lunch for LD23. Kind of late but I wait until I’m hungry.

    Chicken and Vegetable stir-fry.
    Lunch 1

    Progress
    Screenshot 3
    It’s coming a long, but I’m feeling the pressure. My task list seems too long. Worst part is I’ve hit a bug! Maybe you can help? My FlashPunk Entity is not calling the Update method! I’ve triple checked and the World Update is being called and calling the supper.Update()!

    package SeedsOfDestruction
    {
    import com.greensock.easing.Cubic;
    import com.greensock.easing.Quad;
    import com.greensock.TweenMax;
    import flash.display.BitmapData;
    import net.flashpunk.Entity;
    import net.flashpunk.FP;
    import net.flashpunk.graphics.Image;

    public class SeedBullet extends Entity
    {
    [Embed(source = "/assets/Seed Bullet.png")] public static const SEED_BULLET:Class;

    public static const SPEED:Number = 200;

    public var image:Image;

    public function SeedBullet(player:Player)
    {
    // Make the Pink transparent
    var bitmapData:BitmapData = Global.MakeTransparent(SEED_BULLET);
    image = new Image(bitmapData);

    super(x, y, image);

    FP.angleXY(this, player.stem.angle, 40, player.x, player.y);
    image.angle = player.stem.angle;
    image.centerOrigin();
    image.smooth = true;
    active = false;
    layer = 2;

    setHitbox(40, 40);
    type = “seedbullet”;

    trace(“created”);
    }

    override public function update():void
    {
    trace(“update”);
    super.update();

    trace(“update2″);
    if (collide(“BadPlant”, x, y))
    {
    explode();
    }
    }

    override public function added():void
    {
    super.added();

    var time:Number = FP.distance(x, y, world.mouseX, world.mouseY) / SPEED;
    TweenMax.to(this, time, { x:world.mouseX, y:world.mouseY, ease:Quad.easeOut, onComplete:explode } );
    }

    public function explode():void
    {
    world.add(new Explode(this));
    world.remove(this);
    }
    }
    }

    Tags: , , , , ,

    One Response to “Lunch #1 and Serious Bug”

    1. MrPhil says:

      I FOUND it!!!

      active = false; // This tells it NOT to update.

      active property
      public var active:Boolean = false
      If the graphic should update.

    Leave a Reply

    You must be logged in to post a comment.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]