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
1e3632af
Commit
1e3632af
authored
Apr 19, 2019
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
bbbdbae3
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
43 deletions
+64
-43
test.pfb
assets/prefabs/test.pfb
+0
-27
test.pfb.meta
assets/prefabs/test.pfb.meta
+0
-1
BallItem.ts
assets/scripts/scenes/BallItem.ts
+8
-5
ScenePlay.ts
assets/scripts/scenes/ScenePlay.ts
+9
-8
gameconst.ts
assets/scripts/scenes/gameconst.ts
+1
-0
bundle.js
debug/bundle.js
+42
-1
bundle.js.map
debug/bundle.js.map
+1
-1
MustCompile.ts
src/generated/MustCompile.ts
+3
-0
No files found.
assets/prefabs/test.pfb
deleted
100644 → 0
View file @
bbbdbae3
{
"name": "test",
"root": {
"uuid": "20190301114308",
components: [
{
"script": "components/base/Transform"
},
{
"script": "components/other/CameraController"
},
],
"children": [
{
"uuid": "20190301114245",
"name": "test",
"components": [
{
"script": "components/base/Transform",
"properties": {}
},
]
}
]
},
"entity-cache": []
}
\ No newline at end of file
assets/prefabs/test.pfb.meta
deleted
100644 → 0
View file @
bbbdbae3
{"ver":"1.0.1","uuid":"07c47af5-c5fc-4d7f-ad55-b30a06453b34","subMetas":{},"type":"prefab"}
assets/scripts/scenes/BallItem.ts
View file @
1e3632af
import
ScillaComponent
from
'components/base/ScillaComponent'
;
import
{
Transform
}
from
'scilla-components/src'
;
import
{
gravityY
}
from
'./gameconst'
;
export
default
class
BallItem
extends
ScillaComponent
{
private
_speed
=
0
;
private
_speed
Y
=
0
;
onUpdate
()
{
const
{
entity
}
=
this
;
this
.
_speed
+=
1.5
;
entity
.
getComponent
(
Transform
).
position
.
y
+=
this
.
_speed
;
console
.
log
(
'BallItem onUpdate'
)
this
.
_speedY
+=
gravityY
;
entity
.
getComponent
(
Transform
).
position
.
y
+=
this
.
_speedY
;
}
bounceY
(){
this
.
_speedY
*=
-
1
;
}
}
\ No newline at end of file
assets/scripts/scenes/ScenePlay.ts
View file @
1e3632af
...
...
@@ -7,6 +7,7 @@ import { alien } from "../navigator/StackNavigator";
import
{
INavigatorViewBase
}
from
"../navigator/VirtualNavigator"
;
import
{
Transform
}
from
'scilla-components/src'
;
import
ScillaComponent
from
'scilla-components/src/base/ScillaComponent'
;
import
BallItem
from
'./BallItem'
;
const
GROUND_Y
=
250
;
//碰到地板时,球的中心点的y
export
default
class
ScenePlay
extends
ScillaComponent
implements
INavigatorViewBase
{
...
...
@@ -30,14 +31,14 @@ export default class ScenePlay extends ScillaComponent implements INavigatorView
}
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) {
//
}
//
}
for
(
const
ball
of
this
.
ballList
)
{
const
{
position
}
=
ball
.
getComponent
(
Transform
)
;
console
.
log
(
position
.
y
)
if
(
position
.
y
>
GROUND_Y
)
{
position
.
y
=
GROUND_Y
;
(
ball
.
getComponent
(
BallItem
)
as
BallItem
).
bounceY
();
}
}
}
onDidEnter
(
last
:
string
,
action
:
alien
.
NavigatorAction
,
parameters
:
any
):
void
{
...
...
assets/scripts/scenes/gameconst.ts
0 → 100644
View file @
1e3632af
export
const
gravityY
=
1.5
;
\ No newline at end of file
debug/bundle.js
View file @
1e3632af
...
...
@@ -7083,6 +7083,27 @@
return
Popup
;
}(
Component
));
var
gravityY
=
1.5
;
var
BallItem
=
(
function
(
_super
)
{
__extends
(
BallItem
,
_super
);
function
BallItem
()
{
var
_this
=
_super
!==
null
&&
_super
.
apply
(
this
,
arguments
)
||
this
;
_this
.
_speedY
=
0
;
return
_this
;
}
BallItem
.
prototype
.
onUpdate
=
function
()
{
var
entity
=
this
.
entity
;
this
.
_speedY
+=
gravityY
;
entity
.
getComponent
(
Transform
).
position
.
y
+=
this
.
_speedY
;
};
BallItem
.
prototype
.
bounceY
=
function
()
{
this
.
_speedY
*=
-
1
;
};
return
BallItem
;
}(
ScillaComponent
));
var
GROUND_Y
=
250
;
var
ScenePlay
=
(
function
(
_super
)
{
__extends
(
ScenePlay
,
_super
);
function
ScenePlay
()
{
...
...
@@ -7099,6 +7120,25 @@
this
.
ballList
=
[];
};
ScenePlay
.
prototype
.
onUpdate
=
function
()
{
var
e_1
,
_a
;
try
{
for
(
var
_b
=
__values
(
this
.
ballList
),
_c
=
_b
.
next
();
!
_c
.
done
;
_c
=
_b
.
next
())
{
var
ball
=
_c
.
value
;
var
position
=
ball
.
getComponent
(
Transform
).
position
;
console
.
log
(
position
.
y
);
if
(
position
.
y
>
GROUND_Y
)
{
position
.
y
=
GROUND_Y
;
ball
.
getComponent
(
BallItem
).
bounceY
();
}
}
}
catch
(
e_1_1
)
{
e_1
=
{
error
:
e_1_1
};
}
finally
{
try
{
if
(
_c
&&
!
_c
.
done
&&
(
_a
=
_b
.
return
))
_a
.
call
(
_b
);
}
finally
{
if
(
e_1
)
throw
e_1
.
error
;
}
}
};
ScenePlay
.
prototype
.
onDidEnter
=
function
(
last
,
action
,
parameters
)
{
this
.
entity
.
getComponent
(
Transform
).
alpha
=
1
;
...
...
@@ -7389,7 +7429,8 @@
registerDef
(
'./scripts/popup/Popup'
,
Popup
);
registerDef
(
'./scripts/scenes/ScenePlay'
,
ScenePlay
);
registerDef
(
'./scripts/navigator/SingleSceneNavigator'
,
SingleSceneNavigator
);
registerDef
(
'./scripts/dialogs/RulePanel'
,
RulePanel
);
registerDef
(
'./scripts/dialogs/RulePanel'
,
RulePanel
);
registerDef
(
'./scripts/scenes/BallItem'
,
BallItem
);
modifyEngineConfig
({
lineHeightRatio
:
1.2
,
...
...
debug/bundle.js.map
View file @
1e3632af
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/generated/MustCompile.ts
View file @
1e3632af
...
...
@@ -49,3 +49,6 @@ registerDef('./scripts/navigator/SingleSceneNavigator', component13);
import
component14
from
'../../assets/scripts/dialogs/RulePanel'
;
registerDef
(
'./scripts/dialogs/RulePanel'
,
component14
);
import
component15
from
'../../assets/scripts/scenes/BallItem'
;
registerDef
(
'./scripts/scenes/BallItem'
,
component15
);
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