Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
DuibaGameTemplate
Commits
8fcb9df7
Commit
8fcb9df7
authored
Jun 16, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
先这样吧
parent
7cff5819
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
ParkourGameScene.ts
src/scenes/ParkourGameScene.ts
+13
-3
No files found.
src/scenes/ParkourGameScene.ts
View file @
8fcb9df7
...
@@ -62,9 +62,7 @@ export class ParkourScene extends Scene {
...
@@ -62,9 +62,7 @@ export class ParkourScene extends Scene {
initEvents
():
void
{
initEvents
():
void
{
this
.
addEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)
this
.
addEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)
GDispatcher
.
addEventListener
(
ParkourGameEvents
.
GAME_COLLESION
,
(
e
)
=>
{
GDispatcher
.
addEventListener
(
ParkourGameEvents
.
GAME_COLLESION
,
this
.
onGameEleCollision
)
console
.
log
(
e
.
data
)
})
this
.
stage
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onGameDetermineMouseDown
,
this
)
this
.
stage
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onGameDetermineMouseDown
,
this
)
...
@@ -72,6 +70,18 @@ export class ParkourScene extends Scene {
...
@@ -72,6 +70,18 @@ export class ParkourScene extends Scene {
// this.stage.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDown, this)
// this.stage.addEventListener(FYGE.MouseEvent.MOUSE_DOWN, this.onMouseDown, this)
}
}
removeEvents
():
void
{
this
.
removeEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
this
.
onEnterFrame
,
this
)
GDispatcher
.
removeEventListener
(
ParkourGameEvents
.
GAME_COLLESION
,
this
.
onGameEleCollision
)
this
.
stage
.
addEventListener
(
FYGE
.
MouseEvent
.
MOUSE_DOWN
,
this
.
onGameDetermineMouseDown
,
this
)
}
onGameEleCollision
(
e
:
FYGE
.
Event
)
{
console
.
log
(
e
.
data
)
}
onGameDetermineMouseDown
(
e
:
FYGE
.
MouseEvent
)
{
onGameDetermineMouseDown
(
e
:
FYGE
.
MouseEvent
)
{
const
startPos
=
{
const
startPos
=
{
x
:
e
.
stageX
,
x
:
e
.
stageX
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment