Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
love_飞影
Neos
Commits
7d0f6506
Commit
7d0f6506
authored
Nov 27, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update drawing duel
parent
41e6afe3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
9 deletions
+23
-9
src/ui/Duel/simpleDuel/config.ts
src/ui/Duel/simpleDuel/config.ts
+2
-2
src/ui/Duel/simpleDuel/mod.tsx
src/ui/Duel/simpleDuel/mod.tsx
+18
-4
src/ui/Duel/simpleDuel/monsters.ts
src/ui/Duel/simpleDuel/monsters.ts
+3
-3
No files found.
src/ui/Duel/simpleDuel/config.ts
View file @
7d0f6506
...
@@ -6,10 +6,10 @@
...
@@ -6,10 +6,10 @@
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
import
*
as
BABYLON
from
"
@babylonjs/core
"
;
export
const
GroundShape
=
()
=>
{
export
const
GroundShape
=
()
=>
{
return
{
width
:
6
,
height
:
6
};
return
{
width
:
9.9
,
height
:
8
};
};
};
export
const
CardSlotShape
=
()
=>
{
export
const
CardSlotShape
=
()
=>
{
return
{
width
:
0.5
,
height
:
0.75
,
depth
:
0.05
};
return
{
width
:
1
,
height
:
1.2
,
depth
:
0.05
};
};
};
export
const
CardSlotRotation
=
()
=>
{
export
const
CardSlotRotation
=
()
=>
{
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
return
new
BABYLON
.
Vector3
(
1.5
,
0
,
0
);
...
...
src/ui/Duel/simpleDuel/mod.tsx
View file @
7d0f6506
...
@@ -43,7 +43,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
...
@@ -43,7 +43,7 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
// 创建Camera
// 创建Camera
const
camera
=
new
BABYLON
.
FreeCamera
(
const
camera
=
new
BABYLON
.
FreeCamera
(
"
camera1
"
,
"
camera1
"
,
new
BABYLON
.
Vector3
(
0
,
5
,
-
1
0
),
// 俯视方向
new
BABYLON
.
Vector3
(
0
,
12
,
0
),
// 俯视方向
scene
scene
);
);
camera
.
setTarget
(
BABYLON
.
Vector3
.
Zero
());
// 俯视向前
camera
.
setTarget
(
BABYLON
.
Vector3
.
Zero
());
// 俯视向前
...
@@ -58,17 +58,31 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
...
@@ -58,17 +58,31 @@ export default class SimpleDuelPlateImpl implements IDuelPlate {
light
.
intensity
=
0.7
;
light
.
intensity
=
0.7
;
// 魔法陷阱区
// 魔法陷阱区
renderMagics
(
scene
);
// renderMagics(scene);
// 怪兽区
// 怪兽区
renderMonsters
(
scene
);
renderMonsters
(
scene
);
// 创建额外怪兽区
// 创建额外怪兽区
renderExtraMonsters
(
scene
);
//
renderExtraMonsters(scene);
// 创建手牌
// 创建手牌
renderHands
(
hands
,
scene
);
renderHands
(
hands
,
scene
);
// 暂时不创建地板
// 创建地板
const
ground
=
BABYLON
.
MeshBuilder
.
CreateGround
(
"
ground
"
,
CONFIG
.
GroundShape
(),
scene
);
const
groundMaterial
=
new
BABYLON
.
StandardMaterial
(
"
groundMaterial
"
,
scene
);
groundMaterial
.
diffuseTexture
=
new
BABYLON
.
Texture
(
`http://localhost:3030/images/newfield.png`
);
ground
.
material
=
groundMaterial
;
// 渲染循环
// 渲染循环
engine
.
runRenderLoop
(()
=>
{
engine
.
runRenderLoop
(()
=>
{
...
...
src/ui/Duel/simpleDuel/monsters.ts
View file @
7d0f6506
...
@@ -2,8 +2,8 @@ import * as BABYLON from "@babylonjs/core";
...
@@ -2,8 +2,8 @@ import * as BABYLON from "@babylonjs/core";
import
*
as
CONFIG
from
"
./config
"
;
import
*
as
CONFIG
from
"
./config
"
;
export
default
(
scene
:
BABYLON
.
Scene
)
=>
{
export
default
(
scene
:
BABYLON
.
Scene
)
=>
{
const
left
=
-
2
;
const
left
=
-
2
.15
;
const
gap
=
1
;
const
gap
=
1
.05
;
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
for
(
let
i
=
0
;
i
<
5
;
i
++
)
{
const
slot
=
BABYLON
.
MeshBuilder
.
CreateBox
(
const
slot
=
BABYLON
.
MeshBuilder
.
CreateBox
(
`monster
${
i
}
`
,
`monster
${
i
}
`
,
...
@@ -11,7 +11,7 @@ export default (scene: BABYLON.Scene) => {
...
@@ -11,7 +11,7 @@ export default (scene: BABYLON.Scene) => {
scene
scene
);
);
// 位置
// 位置
slot
.
position
=
new
BABYLON
.
Vector3
(
left
+
gap
*
i
,
0.5
,
-
2
);
slot
.
position
=
new
BABYLON
.
Vector3
(
left
+
gap
*
i
,
0.5
,
-
2
.5
);
// 旋转
// 旋转
slot
.
rotation
=
CONFIG
.
CardSlotRotation
();
slot
.
rotation
=
CONFIG
.
CardSlotRotation
();
// 材质
// 材质
...
...
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