Page 1 of 1

ImpactJS++ Loose Weapon Entity

Posted: Thu Feb 27, 2014 6:27 am
by zandzpider
Hey!

I've just started working with ImpactJS++ and i wanted to create a weapon sprite (let's say an Axe or a Sword)
that moved together with the character and swings the direction the character hits.

I've tried to extend some of the attack/abilities that comes with ImpactJS++ but i cannot get the sprite/entity to move with my character and i have no idea if it actually does damage the way i want.

(Ever played Starbound or Terraria? i want something like that)

feel free to post code or just hints ;-)

Re: ImpactJS++ Loose Weapon Entity

Posted: Thu Feb 27, 2014 3:07 pm
by hallsofvallhalla
I have not used Impactjs++ but I have done a paper doll system and basically I just have the weapon entity pos.x and pos.y match the player entity po.x and pos.y

something like this in the weapon entity's update

Code: Select all

 var player = ig.game.getEntitiesByType( EntityPlayer )[0];
this.pos.x = player.pos.x + this.offset;
this.pos.y = player.pos.y + this.offset;

where offset = the exact placement on the character.

Re: ImpactJS++ Loose Weapon Entity

Posted: Thu Feb 27, 2014 3:27 pm
by zandzpider
impact++ is rather confusing and i seem to be hacking around alot with alot of guesswork and luck :s urk.

might aswell go ahead and try my shot at some basic impactjs untill i get my shit together

Re: ImpactJS++ Loose Weapon Entity

Posted: Fri Feb 28, 2014 7:01 pm
by Jackolantern
zandzpider wrote:impact++ is rather confusing and i seem to be hacking around alot with alot of guesswork and luck :s urk.

might aswell go ahead and try my shot at some basic impactjs untill i get my stinky bottom putty together
Maybe I jumped the gun a bit by saying to learn Impact++ right in with basic Impact. I just said that because I learned ImpactJS before I++ existed, and when I tried to sit down and learn I++, it was difficult because I already knew the "Impact way", and I wished I had learned I++ from the beginning. But maybe that isn't the best strategy. Try learning Impact first, and then when comfortable check out I++, because what I++ offers is very worth the learning curve. It really gives it world-class engine features that should have been added to the core in the first place.