PeterC Posted March 10, 2015 Share Posted March 10, 2015 Hi, i was wondering if there are any examples on the internet that explains how to implement sword/slash action like zelda 1 on nes. Can't find any examples.I've already implement a shoot options, that will kill the object when the item is outofbounds, For this one i need to say something like "when button down then show sword, but just for 0.5sec" .Any ideas? Thanks in advanced! Grtz,Peter Link to comment Share on other sites More sharing options...
valueerror Posted March 11, 2015 Share Posted March 11, 2015 show and hide isnt the problem.. just set visible to true and a timer to set it to false again. or use an animation with a blank frame at the beginning and it ends with that blank frame again.. so it will show,strike,and disappear again..doesnt link always hold the sword straight up into the air while running? i thought its always visible..the problem i see is how would you enable collision and disable it after the strike again... are you using arcade or p2? Link to comment Share on other sites More sharing options...
valueerror Posted March 11, 2015 Share Posted March 11, 2015 my mario is holding a sword in my demo game here: http://games.xapient.netjust if you want to have a look Link to comment Share on other sites More sharing options...
valueerror Posted March 11, 2015 Share Posted March 11, 2015 sorry... accidential double post ... Link to comment Share on other sites More sharing options...
PeterC Posted March 15, 2015 Author Share Posted March 15, 2015 Thank you, i found an easy solution for it, i'll soon show a demonstration of the idea of my game. (Your game seems to be cool It will give me some new ideas) this.time.events.add(450, (function() { this.delayAttack = true; }), this); this.game.time.events.add(400, (function() { this.isAttack = false; //remove sprite sword here this.sw.kill(); }), this); It will show the sword for certain time and then it will hide again, you can hit again as soon when the time is over. Link to comment Share on other sites More sharing options...
valueerror Posted March 15, 2015 Share Posted March 15, 2015 i'm curious for your solution so please post it when you are ready.... killing and resetting the object is an interesting approach.. i wonder how you will implement the striking animation Link to comment Share on other sites More sharing options...
Recommended Posts