MAYDAY

Gyldstrand

Veteran
Veteran
Joined
Oct 16, 2014
Messages
76
Reaction score
4
Here is the low down.

I have a sprite with 4 pattern attack animations. The attack for melee is different from the attack with a bow. I have my melee weapon attack set up so when I click the left mouse button, TouchInput.isTriggered(), It starts the 4 pattern animation and on the 4th pattern, the end of the swing,  it will check for contact. That works but I can't get the bow attack down. The 4 step animation is like this for bows:

1)  raise bow slightly

2)  bow is raised and drawn back

3)  arrow is released 

4)  lower bow

I am trying to get this attack to work so when TouchInput.isPressed(), pattern 1 and 2 play and then stops and when TouchInput.isReleased(), pattern 3 and 4 play. I can achieve the first half where it stops at pattern 2 with the bow drawn but I cant seem to get the last 2 steps to play on release.

This is how the melee attack is set up:

Game_Player.prototype.meleeAttackEnd = function() { if ($gamePlayer.pattern() === 4) { this.playerReset(); };};Game_Player.prototype.meleeAttackStart = function() { this.actionInProgress(true); $gamePlayer.setWalkAnime(false); playerBlockX = 12; playerMaxPattern = 5; $gamePlayer.resetPattern(); $gamePlayer.setStepAnime(true); this.meleeAttackEnd(); };
Code:
Game_Player.prototype.updateCombat = function() {                                                        // Unarmed    if (this.checkEquipmentSlot(0).wtypeId === null) {                                                // Melee One Hand    } else if (this.checkEquipmentSlot(0).wtypeId <= 30) {        if (this._actionInProgress === false) {            if (TouchInput.isTriggered()) {                this.meleeAttackStart();              };        } else {            this.meleeAttackEnd();        };                                                // Bow    } else if (this.checkEquipmentSlot(0).wtypeId >= 60) {
@#$% it.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,865
Messages
1,017,059
Members
137,575
Latest member
akekaphol101
Top