Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scilla-kickball
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
scilla-kickball
Commits
f7a4f271
Commit
f7a4f271
authored
Apr 19, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
48e34320
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
9 deletions
+55
-9
BallItem.pfb
assets/prefabs/BallItem.pfb
+20
-7
test.pfb
assets/prefabs/test.pfb
+1
-1
BallItem.ts
assets/scripts/scenes/BallItem.ts
+10
-0
BallItem.ts.meta
assets/scripts/scenes/BallItem.ts.meta
+1
-0
ScenePlay.ts
assets/scripts/scenes/ScenePlay.ts
+16
-0
gameconst.ts.meta
assets/scripts/scenes/gameconst.ts.meta
+1
-0
bundle.js
debug/bundle.js
+5
-0
bundle.js.map
debug/bundle.js.map
+1
-1
No files found.
assets/prefabs/BallItem.pfb
View file @
f7a4f271
...
...
@@ -18,13 +18,6 @@
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/other/RelativeLayout",
"properties": {
"top": 0,
"left": 0
}
}
],
"children": [
...
...
@@ -43,6 +36,26 @@
}
],
"uuid": "fb53fa37-a942-4474-901a-582dccd14c93"
},
{
"name": "Label",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
{
"script": "components/renderer/TextRenderer",
"properties": {
"text": "1111",
"fillColor": "rgba(255, 255, 255, 1)",
"textStyle": {
"fontSize": 40
}
}
}
],
"uuid": "8abfc716-7017-4834-a7fa-5ca6c2ce4b3e"
}
]
}
...
...
assets/prefabs/test.pfb
View file @
f7a4f271
...
...
@@ -7,7 +7,7 @@
"script": "components/base/Transform"
},
{
script: 'components/other/CameraController'
"script": "components/other/CameraController"
},
],
"children": [
...
...
assets/scripts/scenes/BallItem.ts
0 → 100644
View file @
f7a4f271
import
{
Component
}
from
'scilla/src'
;
import
{
Transform
}
from
'scilla-components/src'
;
export
default
class
BallItem
extends
Component
{
speed
=
0
;
onUpdate
()
{
const
{
entity
}
=
this
;
this
.
speed
+=
1.5
;
entity
.
getComponent
(
Transform
).
position
.
y
+=
this
.
speed
;
}
}
\ No newline at end of file
assets/scripts/scenes/BallItem.ts.meta
0 → 100644
View file @
f7a4f271
{"ver":"1.0.1","uuid":"13d4186d-890e-49b1-81b5-904757056582","subMetas":{},"type":"script"}
assets/scripts/scenes/ScenePlay.ts
View file @
f7a4f271
...
...
@@ -7,20 +7,36 @@ import { alien } from "../navigator/StackNavigator";
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
const
GROUND_Y
=
250
;
//碰到地板时,球的中心点的y
export
default
class
ScenePlay
extends
Component
implements
INavigatorViewBase
{
BallItemPrefab
:
resource
;
testPrefab
:
resource
;
bulletNumTxt
:
Entity
;
strengthNumTxt
:
Entity
;
ballList
:
Entity
[];
getBallItem
()
{
const
ball
=
instantiate
(
this
.
BallItemPrefab
);
this
.
entity
.
addChild
(
ball
);
this
.
ballList
.
push
(
ball
);
console
.
log
(
ball
.
getComponent
(
Transform
).
position
.
y
);
}
onAwake
()
{
super
.
onAwake
();
this
.
ballList
=
[];
}
onUpdate
()
{
// for (const ball of this.ballList) {
// ball.getComponent(Transform).position.y += 1;
// const y = ball.getComponent(Transform).position.y;
// console.log(ball.getComponent(Transform).position.y);
// if (y > GROUND_Y) {
// }
// }
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
...
...
assets/scripts/scenes/gameconst.ts.meta
0 → 100644
View file @
f7a4f271
{"ver":"1.0.1","uuid":"d64549e1-a233-4e9f-83fd-225a57a7d5cd","subMetas":{},"type":"script"}
debug/bundle.js
View file @
f7a4f271
...
...
@@ -6502,9 +6502,14 @@
ScenePlay
.
prototype
.
getBallItem
=
function
()
{
var
ball
=
instantiate
(
this
.
BallItemPrefab
);
this
.
entity
.
addChild
(
ball
);
this
.
ballList
.
push
(
ball
);
console
.
log
(
ball
.
getComponent
(
Transform
).
position
.
y
);
};
ScenePlay
.
prototype
.
onAwake
=
function
()
{
_super
.
prototype
.
onAwake
.
call
(
this
);
this
.
ballList
=
[];
};
ScenePlay
.
prototype
.
onUpdate
=
function
()
{
};
ScenePlay
.
prototype
.
onDidEnter
=
function
(
last
,
action
,
parameters
)
{
this
.
entity
.
getComponent
(
Transform
).
alpha
=
1
;
...
...
debug/bundle.js.map
View file @
f7a4f271
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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