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
b884b1aa
Commit
b884b1aa
authored
May 15, 2025
by
haiyoucuv
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
8d5c2119
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
Bubble.ts
src/pages/HomePage/Top/Components/Bubble.ts
+13
-3
BubbleMgr.ts
src/pages/HomePage/Top/Components/BubbleMgr.ts
+1
-3
No files found.
src/pages/HomePage/Top/Components/Bubble.ts
View file @
b884b1aa
...
@@ -5,6 +5,7 @@ import store from "@/store/store.ts";
...
@@ -5,6 +5,7 @@ import store from "@/store/store.ts";
import
{
_asyncThrottle
,
prefixInteger
}
from
"@/utils/utils.ts"
;
import
{
_asyncThrottle
,
prefixInteger
}
from
"@/utils/utils.ts"
;
import
API
from
"@/api"
;
import
API
from
"@/api"
;
import
{
GameEvent
,
globalEvent
}
from
"@/pages/HomePage/Top/GameEvent.ts"
;
import
{
GameEvent
,
globalEvent
}
from
"@/pages/HomePage/Top/GameEvent.ts"
;
import
{
BubbleMgr
}
from
"@/pages/HomePage/Top/Components/BubbleMgr.ts"
;
export
interface
IBubbleInfo
{
export
interface
IBubbleInfo
{
id
:
string
;
id
:
string
;
...
@@ -53,12 +54,21 @@ export class Bubble extends Container implements IBase {
...
@@ -53,12 +54,21 @@ export class Bubble extends Container implements IBase {
}
}
onPointerUp
=
_asyncThrottle
(
async
()
=>
{
onPointerUp
=
_asyncThrottle
(
async
()
=>
{
const
{
x
,
y
,
parent
}
=
this
;
const
{
bubbleArr
,
bubbleMap
}
=
parent
as
BubbleMgr
;
const
i
=
bubbleArr
.
indexOf
(
this
);
if
(
i
!==
-
1
)
bubbleArr
[
i
]
=
null
;
bubbleMap
.
delete
(
this
.
id
);
this
.
removeFromParent
();
this
.
destroy
();
const
{
success
,
data
}
=
await
API
.
receiveBubble
({
id
:
this
.
id
});
const
{
success
,
data
}
=
await
API
.
receiveBubble
({
id
:
this
.
id
});
store
.
updateIndexThrottle
();
store
.
updateIndexThrottle
();
if
(
success
)
{
if
(
success
)
{
globalEvent
.
emit
(
GameEvent
.
ReceiveEffect
,
this
.
position
);
globalEvent
.
emit
(
GameEvent
.
ReceiveEffect
,
{
x
,
y
});
this
.
removeFromParent
();
this
.
destroy
();
}
}
});
});
...
...
src/pages/HomePage/Top/Components/BubbleMgr.ts
View file @
b884b1aa
...
@@ -25,7 +25,6 @@ export class BubbleMgr extends Base {
...
@@ -25,7 +25,6 @@ export class BubbleMgr extends Base {
@
reactor
(()
=>
store
.
indexData
.
bubbleRecords
)
@
reactor
(()
=>
store
.
indexData
.
bubbleRecords
)
updateBubble
(
bubbleRecords
:
IBubbleInfo
[])
{
updateBubble
(
bubbleRecords
:
IBubbleInfo
[])
{
const
newBubbleKeys
=
[];
const
newBubbleKeys
=
[];
bubbleRecords
.
forEach
((
info
)
=>
newBubbleKeys
.
push
(
info
.
id
));
bubbleRecords
.
forEach
((
info
)
=>
newBubbleKeys
.
push
(
info
.
id
));
...
@@ -43,6 +42,7 @@ export class BubbleMgr extends Base {
...
@@ -43,6 +42,7 @@ export class BubbleMgr extends Base {
const
{
id
}
=
info
;
const
{
id
}
=
info
;
let
bubble
=
this
.
bubbleMap
.
get
(
id
);
let
bubble
=
this
.
bubbleMap
.
get
(
id
);
if
(
!
bubble
)
{
if
(
!
bubble
)
{
bubble
=
this
.
addChild
(
new
Bubble
());
bubble
=
this
.
addChild
(
new
Bubble
());
...
@@ -55,8 +55,6 @@ export class BubbleMgr extends Base {
...
@@ -55,8 +55,6 @@ export class BubbleMgr extends Base {
}
}
}
}
console
.
log
(
emptyPos
);
bubble
.
position
.
set
(
posArr
[
emptyPos
].
x
,
posArr
[
emptyPos
].
y
)
bubble
.
position
.
set
(
posArr
[
emptyPos
].
x
,
posArr
[
emptyPos
].
y
)
bubble
.
ideaEffect
(
150
*
index
,
Math
.
random
()
>
0.5
?
1
:
-
1
);
bubble
.
ideaEffect
(
150
*
index
,
Math
.
random
()
>
0.5
?
1
:
-
1
);
...
...
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