Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kww_dayDayGetCredits_250512
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
SparkProjects
kww_dayDayGetCredits_250512
Commits
015df223
Commit
015df223
authored
May 13, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
d92410fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
3 deletions
+18
-3
Game.ts
src/pages/HomePage/Top/Game.ts
+13
-1
Helper.ts
src/pages/HomePage/Top/Helper.ts
+5
-2
No files found.
src/pages/HomePage/Top/Game.ts
View file @
015df223
import
{
Assets
,
Container
,
PointData
,
Sprite
,
Ticker
}
from
"pixi.js"
;
import
{
A
nimatedSprite
,
A
ssets
,
Container
,
PointData
,
Sprite
,
Ticker
}
from
"pixi.js"
;
import
'pixi.js/math-extras'
;
import
{
prefixInteger
}
from
"@/utils/utils.ts"
;
export
class
Game
extends
Container
{
...
...
@@ -12,6 +13,17 @@ export class Game extends Container {
const
bg
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
"招财猫_底.png"
)));
bg
.
position
.
set
(
168
,
332
);
const
textures
=
new
Array
(
300
).
fill
(
0
).
map
((
_
,
i
)
=>
{
return
Assets
.
get
(
`落金币/落金币_
${
prefixInteger
(
i
,
5
)}
.png`
);
});
const
as
=
this
.
addChild
(
new
AnimatedSprite
(
textures
));
as
.
scale
.
set
(
0.66
,
0.66
);
as
.
anchor
.
set
(
0.5
);
as
.
position
.
set
(
375
,
553
);
as
.
loop
=
false
;
as
.
play
();
const
top
=
this
.
addChild
(
new
Sprite
(
Assets
.
get
(
"招财猫_叠.png"
)));
top
.
position
.
set
(
168
,
332
);
...
...
src/pages/HomePage/Top/Helper.ts
View file @
015df223
...
...
@@ -10,8 +10,6 @@ const files = import.meta.glob(`../../../assets/Game/**/*`, {
eager
:
true
,
});
console
.
log
(
files
)
const
bundleCfg
=
{
name
:
"Game"
,
assets
:
[]
...
...
@@ -26,7 +24,11 @@ for (const key in files) {
manifest
.
bundles
.
push
(
bundleCfg
);
let
inited
=
false
;
export
async
function
initBundle
():
Promise
<
void
>
{
if
(
inited
)
return
Promise
.
resolve
();
console
.
time
(
"initBundle"
);
await
Assets
.
init
({
manifest
:
manifest
,
...
...
@@ -37,4 +39,5 @@ export async function initBundle(): Promise<void> {
});
Assets
.
backgroundLoadBundle
([
"Game"
]);
console
.
timeEnd
(
"initBundle"
);
inited
=
true
;
}
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