Animating/Moving CHANGEABLE weapons/armor through code? (equipping items) - PAPERDOLLING -


(John Andersson) #22
	override public function update():void 
	{
		if (!_stuck)
		{
			var sb:Hero = Hero(collide("hero", x, y));

			if (sb != null)
			{
				// Hit a sticky block.
				stuckOffset = sb.attachBlock(this).subtract(new Point(x, y));
				_stuck = true;
			}
		}
super.update();
}

(John Andersson) #23

Please check my other thread John's Epic Megathread Of Confusion & Tomfoolery.

The problem persists with SPRITEMAPS now. They don’t play as soon as the hero spritemap starts playing. They are one step behind. I made sure that the spritemaps are equal in terms of placement of the armor in regards to the hero. I basically just took the hero spritemap, replaced his legs (for example) with armored legs and removed the hero graphic. So the leg armor has its own spritemap where its locations is relative to the hero.