Repository navigation
Expand file tree
/
Copy patheventlogic.lua
More file actions
64 lines (59 loc) · 1.86 KB
/
Copy patheventlogic.lua
File metadata and controls
64 lines (59 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
------------------------------------------------------------------
local function touchArrowCheck(self, event)
if event.x < display.contentCenterX then
if event.x > self.contentBounds.xMin and
event.x < self.contentBounds.xMax and
event.y > self.contentBounds.yMin and
event.y < self.contentBounds.yMax
then
print("Its "..self.id.." IN")
upArrow.alpha = rhG
downArrow.alpha = rhG
leftArrow.alpha = rhG
rightArrow.alpha = rhG
self.alpha = rFG
self._touch_num = self._touch_num + 1
GameSettings.playerIsMoving = self.idNum
GameSettings.playerIsFirstMoving = 1
GameSettings.playerMoveAttack = 1
GameSettings.playerIsDirection = self.id
spriteCallNum = spriteCallNum+1
end
if
(event.phase == "ended" or event.phase == "cancelled")
then
print("Its out")
if GameSettings.chargeInitiated < 2 then
player0:setSequence("stopped")
player0:play()
end
GameSettings.playerIsMoving = 0
GameSettings.playerIsFirstMoving = 0
GameSettings.playerMoveAttack = 0
GameSettings.playerIsDirection = nil
spriteCallNum = 0
self._touch_num = 0
setAlphaButtons()
end
end
return true
end
local function deadMoveTouch( self, event)
if GameSettings.chargeInitiated < 2 then
--print("Touched "..self.." and stopped movement")
print("WORKING NOW AAA")
player0:setSequence("stopped")
player0:play()
GameSettings.playerIsMoving = 0
GameSettings.playerIsFirstMoving = 0
GameSettings.playerMoveAttack = 0
GameSettings.playerIsDirection = nil
spriteCallNum = 0
upArrow._touch_num = 0
downArrow._touch_num = 0
rightArrow._touch_num = 0
leftArrow._touch_num = 0
setAlphaButtons()
end
end
------------------------------------------------------------------