Now:
October Challenge 2014
Ends in:

Coming Soon:
Ludum Dare 31
December 5th-8th, 2014

PST: 6 PM
*EST: 9 PM
UTC: 02:00

ConstructionPlease excuse the site weirdness. Mike is making and fixing things. Clocks are probably wrong. Colors are place-holder.

Ludum Dare 31:
Ludum Deals
???
 
Recent:
MiniLD #XX

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.


[cache: storing page]