Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
game-stydy
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
谌继荃
game-stydy
Commits
d87b0f18
Commit
d87b0f18
authored
Nov 18, 2021
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
b1c1c5bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
addGame.ts
src/addGame.ts
+7
-1
No files found.
src/addGame.ts
View file @
d87b0f18
export
function
addGame
(
stage
:
FYGE
.
Stage
)
{
export
function
addGame
(
stage
:
FYGE
.
Stage
)
{
const
INITIAL_POSITION
=
{
x
:
0
,
y
:
1000
};
//初始位置
const
plane
=
stage
.
addChild
(
FYGE
.
Sprite
.
fromUrl
(
'//yun.duiba.com.cn/spark/assets/hero_fly1.f292cb1c04589c6ee395fe29538d5385540755f7.png'
));
plane
.
position
.
set
(
INITIAL_POSITION
.
x
,
INITIAL_POSITION
.
y
);
const
SPEED
=
2
;
function
onEnterFrame
()
{
plane
.
y
-=
SPEED
;
}
plane
.
addEventListener
(
FYGE
.
Event
.
ENTER_FRAME
,
onEnterFrame
);
}
}
\ No newline at end of file
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