Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
shuijf
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
shuijf
Commits
dcfce110
Commit
dcfce110
authored
Jun 21, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
b1d175e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
32 deletions
+27
-32
Drop.ts
assets/scripts/scenes/Drop.ts
+19
-12
SceneStart.ts
assets/scripts/scenes/SceneStart.ts
+6
-18
bg.jpg
assets/singles/bg.jpg
+0
-0
cankao.jpg
assets/singles/cankao.jpg
+0
-0
MustCompile.ts
src/generated/MustCompile.ts
+2
-2
No files found.
assets/scripts/scenes/Drop.ts
View file @
dcfce110
import
ScillaComponent
from
'components/base/ScillaComponent'
;
import
{
Entity
}
from
'scilla/src'
;
import
{
setXY
}
from
'../transformUtils'
;
import
{
setY
,
getY
}
from
'../transformUtils'
;
export
default
class
Drop
extends
ScillaComponent
{
private
G
=
.
7
;
private
_v
=
0
;
onAwake
()
{
super
.
onAwake
();
console
.
log
(
'fuckon awake'
)
this
.
reset
();
}
callback
;
reset
()
{
//
const { children } = this.entity;
//
const index = Math.floor(Math.random() * children.length);
// const drop=
children[index];
//
children.forEach((v, i) => {
//
v.enabled = index == i;
//
});
// // setXY(drop,)
const
{
children
}
=
this
.
entity
;
const
index
=
Math
.
floor
(
Math
.
random
()
*
children
.
length
);
const
drop
=
children
[
index
];
children
.
forEach
((
v
,
i
)
=>
{
v
.
enabled
=
index
==
i
;
});
this
.
_v
=
3
;
setY
(
this
.
entity
,
-
400
);
}
onUpdate
(
t
)
{
super
.
onUpdate
(
t
);
this
.
_v
+=
this
.
G
;
setY
(
this
.
entity
,
getY
(
this
.
entity
)
+
this
.
_v
);
if
(
getY
(
this
.
entity
)
>
100
)
{
this
.
callback
();
this
.
entity
.
enabled
=
false
;
}
}
}
assets/scripts/scenes/SceneStart.ts
View file @
dcfce110
...
...
@@ -29,31 +29,19 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
super
.
onAwake
();
if
(
!
this
.
_drop
)
{
this
.
_drop
=
instantiate
(
this
.
Drop
).
getComponent
(
Drop
);
// this._drop.entity.enabled = false;
this
.
_drop
.
entity
.
enabled
=
false
;
this
.
_drop
.
callback
=
this
.
dropEndCallback
;
this
.
entity
.
addChild
(
this
.
_drop
.
entity
);
}
}
// private setCountText(text: string)
{
// setText(this.countTxt, text
);
//
}
dropEndCallback
=
()
=>
{
this
.
onShakeOver
(
);
}
initGameStage
()
{
// // this.updateCountText();
// this.bubbling('showToast', '活动还未开始\n敬请期待')
}
// updateCountText() {
// const { element } = this.ajaxElement;
// let text = ''
// if (element.freeLimit > 0) {
// text = `今日剩余免费次数:${element.freeLimit}次`;
// } else {
// text = `${element.needCredits}${window['CFG'].unitName}/次`
// }
// this.setCountText(text);
// }
onClick_startbtn
()
{
this
.
startbtn
.
getComponent
(
Button
).
enabled
=
false
;
this
.
_shakeTimes
=
this
.
SHAK_TIMERS
;
...
...
@@ -95,7 +83,7 @@ export default class SceneStart extends ScillaComponent implements INavigatorVie
setRotation
(
this
.
treeWrapper
,
-
getRotation
(
this
.
treeWrapper
))
if
(
this
.
_shakeTimes
<=
0
)
{
setRotation
(
this
.
treeWrapper
,
0
);
this
.
onShakeOver
()
;
this
.
_drop
.
entity
.
enabled
=
true
;
}
this
.
_counter
=
this
.
FREQ
;
}
else
{
...
...
assets/singles/bg.jpg
View replaced file @
b1d175e4
View file @
dcfce110
51 KB
|
W:
|
H:
111 KB
|
W:
|
H:
2-up
Swipe
Onion skin
assets/singles/cankao.jpg
View replaced file @
b1d175e4
View file @
dcfce110
161 KB
|
W:
|
H:
127 KB
|
W:
|
H:
2-up
Swipe
Onion skin
src/generated/MustCompile.ts
View file @
dcfce110
...
...
@@ -2,8 +2,8 @@
* THIS FILE WAS GENERATE BY COMPILER
* DO NOT MODIFY THIS FILE
*/
import
{
registerDef
}
from
'scilla'
import
{
registerDef
}
from
'scilla'
import
component0
from
'components/other/RelativeLayout'
;
registerDef
(
'components/other/RelativeLayout'
,
component0
);
...
...
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