Skip to content

Commit 4b0fee7

Browse files
committed
cheated sun spawns at the cursor now
1 parent 35a8a62 commit 4b0fee7

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

game/js/Cfunction.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ var $User = (function () {
6767
SaveLvl: 1,
6868
SaveLvlCallBack: null,
6969
},
70+
Mouse: { x: 0, y: 0 },
7071
};
7172
})();
7273

@@ -2666,6 +2667,8 @@ var AppearSun = function (x, y, amount, isDrop) {
26662667
if (oS.AutoSun) {
26672668
oSym.addTask(100, ClickSun, [id]);
26682669
}
2670+
2671+
return id;
26692672
};
26702673

26712674
var MoveDropSun = function (id, targetY) {

game/js/Cheatcodes.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,10 @@ document.addEventListener("keydown", (event) => {
4040
}
4141
// sun (j)
4242
else if (keySequence.includes("j")) {
43-
AppearSun(GetX(Math.floor(1 + Math.random() * oS.C)), GetY(Math.floor(1 + Math.random() * oS.R)), 25, 1);
43+
const sunId = AppearSun($User.Mouse.x - 45, $User.Mouse.y + 45, 25, false);
44+
if (!oS.AutoSun) {
45+
oSym.addTask(Math.round(1000 / oSym.TimeStep), ClickSun, [sunId]);
46+
}
4447
keySequence = "";
4548
}
4649
// oneko (cat)

game/level/0.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,10 @@ oS.Init({
116116
$("tGround")
117117
);
118118
EBody = document.body;
119+
$User.Mouse.listener = EBody.addEventListener("mousemove", (event) => {
120+
$User.Mouse.x = ((event.clientX - EDAlloffsetLeft + EBody.scrollLeft || EElement.scrollLeft) * 10) / 9;
121+
$User.Mouse.y = event.clientY + EBody.scrollTop || EElement.scrollTop;
122+
});
119123
EElement = document.documentElement;
120124
EDAll.scrollLeft = 0;
121125
EDAll.innerHTML += WordUTF8;

0 commit comments

Comments
 (0)