Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nytelytee committed Feb 28, 2024
0 parents commit 5feaeb3
Show file tree
Hide file tree
Showing 11 changed files with 820 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Build Geode Mod

on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: Windows
os: windows-latest
target: Win32
- name: Android32
os: ubuntu-latest
target: Android32
- name: Android64
os: ubuntu-latest
target: Android64


name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'

- name: Build the mod
uses: geode-sdk/build-geode-mod@main
with:
sdk: nightly
#build-config: 'RelWithDebInfo'
combine: true
target: ${{ matrix.config.target }}

package:
name: Package builds
runs-on: ubuntu-latest
needs: ['build']
steps:
- uses: geode-sdk/build-geode-mod@combine
id: build

- uses: actions/upload-artifact@v3
with:
name: Wave Trail Drag Fix
path: ${{ steps.build.outputs.build-output }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/build
24 changes: 24 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cmake_minimum_required(VERSION 3.21)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_ARCHITECTURES "x86_64")
set(CMAKE_CXX_VISIBILITY_PRESET hidden)

project(WaveTrailDragFix VERSION 1.0.0)

# Set up the mod binary
add_library(${PROJECT_NAME} SHARED
src/main.cpp
# Add your cpp files here
)

if (NOT DEFINED ENV{GEODE_SDK})
message(FATAL_ERROR "Unable to find Geode SDK! Please define GEODE_SDK environment variable to point to Geode")
else()
message(STATUS "Found Geode: $ENV{GEODE_SDK}")
endif()

add_subdirectory($ENV{GEODE_SDK} ${CMAKE_CURRENT_BINARY_DIR}/geode)

# Set up dependencies, resources, link Geode
setup_geode_mod(${PROJECT_NAME})
675 changes: 675 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Wave Trail Drag Fix

Fix the wave trail being buggy on D blocks.
10 changes: 10 additions & 0 deletions about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Wave Trail Drag Fix
Fixes the wave trail when interacting with D-blocks.

![without](nytelyte.wave_trail_drag_fix/without.png)

Without the mod

![with](nytelyte.wave_trail_drag_fix/with.png)

With the mod
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions mod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"geode": "2.0.0-beta.19",
"gd": {
"android": "2.205",
"win": "2.204"
},
"version": "v1.0.0",
"id": "nytelyte.wave_trail_drag_fix",
"name": "Wave Trail Drag Fix",
"developer": "NyteLyte",
"description": "Fix the wave trail being buggy on D blocks.",
"resources": {
"sprites": [
"resources/with.png",
"resources/without.png"
]
}
}
Binary file added resources/with.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/without.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include <Geode/Geode.hpp>
#include <Geode/modify/PlayerObject.hpp>
using namespace geode::prelude;

cocos2d::CCPoint prev_position(0, 0);
bool dont_add_point = true;
float prev_yVelocity = -3001;

class $modify(PlayerObject) {
void update(float p0) {
if (m_isDart) {
// exiting a straight area, put the point on the previous
// frame's position (where the wave was while it was still on
// the straight area)
if (m_yVelocity != 0 && prev_yVelocity == 0) {
if (dont_add_point) dont_add_point = false;
else m_waveTrail->addPoint(prev_position);
prev_yVelocity = m_yVelocity;
}
// entering a straight area, put the point on the current
// frame's position (the wave just landed on the straight area)
else if (m_yVelocity == 0 && prev_yVelocity != 0) {
if (dont_add_point) dont_add_point = false;
else m_waveTrail->addPoint(m_position);
prev_yVelocity = m_yVelocity;
}
prev_position = m_position;

// result: straight line on straight area
}
PlayerObject::update(p0);
}
void resetStreak() {
dont_add_point = true;
PlayerObject::resetStreak();
}
};

0 comments on commit 5feaeb3

Please sign in to comment.