Skip to content

Commit

Permalink
θ­¦ι’Ÿζ•²ηƒ‚: enLane = lane + laneLength - 1 !!! πŸ˜’ (Merge Pull Request #15)
Browse files Browse the repository at this point in the history
θ­¦ι’Ÿζ•²ηƒ‚: enLane = lane + laneLength - 1 !!! πŸ˜’
  • Loading branch information
LittleYang0531 authored Jan 6, 2024
2 parents 02274ce + 630332b commit a7f7cbe
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
Binary file modified dist/EngineData
Binary file not shown.
17 changes: 16 additions & 1 deletion engine/data/archetypes/InputManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ClaimManager {
ClaimInfo getInfo(let id) {
let time = EntityDataArray[id].get(0);
let lane = EntityDataArray[id].get(1);
let enLane = EntityDataArray[id].get(2) + lane;
let enLane = EntityDataArray[id].get(2) + lane - 1;
return {
index: id,
time: time,
Expand All @@ -36,6 +36,10 @@ class ClaimManager {
IF (touches[i].started == 0) CONTINUE; FI
// Debuglog(origin.fullHitbox.l); Debuglog(origin.fullHitbox.r);
IF (origin.fullHitbox.contain(touches[i].x, touches[i].y) == 0) CONTINUE; FI
// IF (EntityDataArray[index].get(1) == 4 && EntityDataArray[index].get(2) == 3)
// Debuglog(origin.fullHitbox.l);
// Debuglog(origin.fullHitbox.r);
// DebugPause(); FI

let dis = Abs(touches[i].x - x);
IF (res != -1 && minDis <= dis) CONTINUE; FI
Expand Down Expand Up @@ -271,4 +275,15 @@ class InputManager: public Archetype {
// } DONE
// return VOID;
}

SonolusApi touch() {
FUNCBEGIN
Rect hitbox = getFullHitbox(4, 6);
FOR (i, 0, touches.size, 1) {
IF (touches[i].started == 0) CONTINUE; FI
Debuglog(hitbox.l); Debuglog(hitbox.r);
Debuglog(touches[i].x); Debuglog(hitbox.contain(touches[i].x, touches[i].y));
} DONE
return VOID;
}
};
2 changes: 1 addition & 1 deletion engine/data/archetypes/Stage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Stage: public Archetype {
FUNCBEGIN
Draw(Sprites.Stage, stage.l, stage.b, stage.l * highWidth, stage.t, stage.r * highWidth, stage.t, stage.r, stage.b, 1, 1);
Draw(Sprites.StageBackground, stage.l, stage.b, stage.l * highWidth, stage.t, stage.r * highWidth, stage.t, stage.r, stage.b, 2, 0.6);
// IF (LevelOption.get(Options.Hidden) != 0) { drawHiddenLine(); } FI,
IF (LevelOption.get(Options.Hidden) != 0) drawHiddenLine(); FI
Draw(Sprites.Judgeline, judgline.lbX, judgline.lbY, judgline.ltX, judgline.ltY, judgline.rtX, judgline.rtY, judgline.rbX, judgline.rbY, 3, 1);
drawJudgeText();
return VOID;
Expand Down
3 changes: 3 additions & 0 deletions engine/data/archetypes/flatNotes/FlatNote.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ class FlatNote : public Archetype {
SonolusApi updateParallel() {
FUNCBEGIN
drawNormalNote(getSprite(), lane, enLane, beat);
Rect hitbox = getFullHitbox(lane, enLane);
hitbox.b = -0.2, hitbox.t = 0.2;
// Draw(Sprites.SyncLine, hitbox.l, hitbox.b, hitbox.l, hitbox.t, hitbox.r, hitbox.t, hitbox.r, hitbox.b, 100000, 1);
// let index = getTouch(lane, enLane);
// touchIndex = index;
return VOID;
Expand Down
23 changes: 22 additions & 1 deletion engine/data/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ SonolusApi drawTick(let sprite, let beat, let lane, let enLane) {
auto m1 = line1.getWidth(p - tickHeight / 2 / stage.h * multiplier) / lines[lane].getWidth(1);
auto m2 = line1.getWidth(p + tickHeight / 2 / stage.h * multiplier) / lines[lane].getWidth(1);
auto cb = Vec((c2.x + c4.x) / 2, (c2.y + c4.y) / 2), ct = Vec((c1.x + c3.x) / 2, (c1.y + c3.y) / 2);
auto lb = cb + Vec(-1 * m2 * tickWidth / 2, 0), lt = ct + Vec(-1 * m1 * tickWidth / 2, 0);
auto lb = cb - Vec(m2 * tickWidth / 2, 0), lt = ct - Vec(m1 * tickWidth / 2, 0);
auto rb = cb + Vec(m2 * tickWidth / 2, 0), rt = ct + Vec(m1 * tickWidth / 2, 0);
Draw(sprite, lb.x, lb.y, lt.x, lt.y, rt.x, rt.y, rb.x, rb.y, 1000 - beat, 0.5);
return VOID;
Expand All @@ -246,6 +246,27 @@ SonolusApi drawSyncLine(let beat, let lane, let enLane) {
return VOID;
}

SonolusApi drawHiddenLine() {
FUNCBEGIN
let sprite = Sprites.HiddenLine, lane = 1, enLane = 12, beat = times.now + (1 - LevelOption.get(Options.Hidden)) * appearTime;
var p = ease((times.now - beat) / appearTime + 1);
auto line1 = lines[lane], line2 = lines[enLane];
auto w = line1.getWidth(p);
auto multiplier = w / lines[lane].getWidth(1);
auto c1 = line1.getPosition(p - hiddenLineHeight / 2 / stage.h * multiplier);
auto c2 = line1.getPosition(p + hiddenLineHeight / 2 / stage.h * multiplier);
auto c3 = line2.getPosition(p - hiddenLineHeight / 2 / stage.h * multiplier);
auto c4 = line2.getPosition(p + hiddenLineHeight / 2 / stage.h * multiplier);
auto w1 = line1.getWidth(p - hiddenLineHeight / 2 / stage.h * multiplier);
auto w2 = line1.getWidth(p + hiddenLineHeight / 2 / stage.h * multiplier);
auto lb = c2 - Vec(w2 / 2 - noteMoveLength * w1 / line1.getWidth(1), 0),
lt = c1 - Vec(w1 / 2 - noteMoveLength * w2 / line1.getWidth(1), 0);
auto rb = c4 + Vec(w2 / 2 - noteMoveLength * w1 / line1.getWidth(1), 0),
rt = c3 + Vec(w1 / 2 - noteMoveLength * w2 / line1.getWidth(1), 0);
Draw(sprite, lb.x, lb.y, lt.x, lt.y, rt.x, rt.y, rb.x, rb.y, 10, 0.6);
return VOID;
}

SonolusApi spawnLineEffect(let lane, let enLane) {
FUNCBEGIN
let wt = lines[lane].getFullWidth(0), wb = lines[lane].getFullWidth(1);
Expand Down
Binary file modified main
Binary file not shown.

0 comments on commit a7f7cbe

Please sign in to comment.