Updated anim of the second character.

This commit is contained in:
genxium
2022-12-17 17:33:14 +08:00
parent 8647c1a859
commit 4e42c0770c
33 changed files with 2490 additions and 1443 deletions

View File

@@ -98,7 +98,7 @@ cc.Class({
}
let newCharacterState = rdfPlayer.characterState;
const newAnimName = window.ATK_CHARACTER_STATE_ARR[newCharacterState][1];
let newAnimName = window.ATK_CHARACTER_STATE_ARR[newCharacterState][1];
let playingAnimName = null;
let underlyingAnimationCtrl = null;

View File

@@ -779,7 +779,7 @@ cc.Class({
if (1 == joinIndex) {
playerScriptIns.setSpecies("SoldierWaterGhost");
} else if (2 == joinIndex) {
playerScriptIns.setSpecies("SoldierFireGhostFrameAnim");
playerScriptIns.setSpecies("UltramanTiga");
}
const [wx, wy] = self.virtualGridToWorldPos(vx, vy);

View File

@@ -47,7 +47,7 @@ cc.Class({
1: {
// for offender
startupFrames: 10,
activeFrames: 3,
activeFrames: 20,
recoveryFrames: 34, // usually but not always "startupFrames+activeFrames", I hereby set it to be 1 frame more than the actual animation to avoid critical transition, i.e. when the animation is 1 frame from ending but "rdfPlayer.framesToRecover" is already counted 0 and the player triggers an other same attack, making an effective bullet trigger but no animation is played due to same animName is still playing
recoveryFramesOnBlock: 34,
recoveryFramesOnHit: 34,
@@ -196,7 +196,7 @@ cc.Class({
}
});
self.selfPlayerInfo = {
id: 10
id: 11
};
self._initPlayerRichInfoDict(startRdf.players);
self.onRoomDownsyncFrame(startRdf);

View File

@@ -88,6 +88,14 @@ cc.Class({
default: 0.0375,
type: cc.Float
},
btnA: {
default: null,
type: cc.Node
},
btnB: {
default: null,
type: cc.Node
},
},
start() {},
@@ -137,6 +145,7 @@ cc.Class({
});
translationListenerNode.inTouchPoints = new Map();
/*
zoomingListenerNode.on(cc.Node.EventType.TOUCH_START, function(event) {
self._touchStartEvent(event);
});
@@ -150,6 +159,37 @@ cc.Class({
self._touchEndEvent(event);
});
zoomingListenerNode.inTouchPoints = new Map();
*/
if (self.btnA) {
self.btnA.on(cc.Node.EventType.TOUCH_START, function(evt) {
self.cachedBtnALevel = 1;
evt.target.runAction(cc.scaleTo(0.1, 0.3));
});
self.btnA.on(cc.Node.EventType.TOUCH_END, function(evt) {
self.cachedBtnALevel = 0;
evt.target.runAction(cc.scaleTo(0.1, 1.0));
});
self.btnA.on(cc.Node.EventType.TOUCH_CANCEL, function(evt) {
self.cachedBtnALevel = 0;
evt.target.runAction(cc.scaleTo(0.1, 1.0));
});
}
if (self.btnB) {
self.btnB.on(cc.Node.EventType.TOUCH_START, function(evt) {
self.cachedBtnBLevel = 1;
evt.target.runAction(cc.scaleTo(0.1, 0.3));
});
self.btnB.on(cc.Node.EventType.TOUCH_END, function(evt) {
self.cachedBtnBLevel = 0;
evt.target.runAction(cc.scaleTo(0.1, 1.0));
});
self.btnB.on(cc.Node.EventType.TOUCH_CANCEL, function(evt) {
self.cachedBtnBLevel = 0;
evt.target.runAction(cc.scaleTo(0.1, 1.0));
});
}
// Setup keyboard controls for the ease of attach debugging
cc.systemEvent.on(cc.SystemEvent.EventType.KEY_DOWN, function(evt) {