Code for Geometry Dash level 1 – 3

Code for Geometry Dash level 1 – 3

Level 1. Stereo Madness
Level 2. Back on Track
Level 3. Poltergeist

[code language=”arduino”]
/*
* Arduino Game Solver: Geometry Dash Level 1-3
* by: ndoware.com
* July 2020
*
* Cara membuat stylus, pasang aluminium foil di pegangan servo lalu hubungkan dengan GND di Arduino
* How to make a stylus, put aluminum foil in the servo handle then connect it to the GND in Arduino
*/

#include <Servo.h>
Servo myservo;

// Sesuaikan konfigurasi || Match with your devices

#define SERVOPIN 9
#define BUTTONPIN 2
#define LEDPIN 13

int posNetral = 7; // Posisi netral 7 derajat
int posHit = 15; // Posisi hit 15 derajat

int playLevel = 1; // Which level you want to play?

//

int level[][2][125] = {
{
{ // Level 1. Stereo Madnes
// from menu: 0, 2567 | from retry: 0, 1450
0, 1450, 1400, 1400, 300, 300, 2067, 500, 800, 600, 567, 767, 633, 333, 267, 333, 300, 267, 667, 600, 1600, 300, 1033, 367, 667, 667, 267, 300, 300, 267, 3333,
600, 600, 2100, 633, 633, 1600, 600, 2100, 3200, 300, 700, 933, 300, 290, 290, 260, 300, 267, 1300, 733, 1700, 300, 567, 300, 700, 600,
767, 533, 600, 833, 267, 267, 300, 1333, 1400, 800, 500, 300, 300, 267, 300, 667, 500, 300, 1083, 633, 933, 333, 367, 367, 300, 867, 300, 533, 400, 333, 400,
567, 667, 333, 500, 267, 467, 533, 1100
},
{
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
500, 300, 467, 467, 700, 500, 500, 400, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
633, 400, 1767, 733, 933, 200, 867, 900
}
},
{
{ // Level 2. Back on Track
0, 2100, 800, 267, 1633, 833, 267, 267, 267, 733, 333, 733, 333, 333, 333, 767, 733, 300, 1667, 533, 400, 933, 300, 1000, 333, 800, 367, 267, 1233, 267, 300, 1000,
267, 733, 500, 333, 367, 333, 267, 267, 600, 1233, 933, 900, 367, 267, 3067, 333, 733, 200, 1167, 433, 1367,
767, 867, 600, 333, 433, 1067, 1600, 1833,
333, 433, 333, 500, 1667, 267, 1800, 1667, 667, 567, 833, 367, 433, 633, 333, 800, 1133, 733, 467, 333, 900, 300, 967, 833, 767, 767, 467, 300, 533, 300, 500, 367, 300
},
{
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
633, 700, 500, 300, 1067, 1700, 1700, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
}
},
{
{ // Level 3. Poltergeist
0, 1300, 200, 1033, 267, 967, 267, 367, 300, 267, 533, 433, 800, 300, 1067, 800, 933, 200, 300, 1067, 267, 533, 267, 733, 667, 333, 667, 333, 1633, 267, 400,
467, 367, 300, 1333, 267, 900, 267, 633, 633, 967, 533, 500, 467, 533, 233, 267,
1567, 1800, 1833, 567, 567, 1533,
267, 400, 267, 533, 267, 1200, 367, 333, 200, 333, 300, 567, 467, 300, 300, 267, 267, 1700, 400, 300, 267, 300, 267, 733, 967, 600, 667, 567, 333, 633, 1067, 267, 300, 267, 2333, 367, 333, 400, 900, 1200, 733, 300, 333, 300, 400, 333, 333, 300, 500, 633, 433, 533, 300, 300, 267, 1333, 600, 700, 233, 400, 1200, 367, 467, 1300, 467, 467, 333, 800, 233, 500, 467, 467
},
{
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
567, 233, 567, 1600, 1500, 100,
100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100
}
}
};
int leng[] = {
96, // Level 1. Stereo Madness
94, // Level 2. Back on Track
125 // Level 3. Poltergeist
};

void setup() {
Serial.begin(115200);
pinMode(BUTTONPIN, INPUT_PULLUP);
pinMode(LEDPIN, OUTPUT);

myservo.attach(SERVOPIN);
myservo.write(posNetral); // posisikan servo di netral
}

void loop() {

bool gameRun = !digitalRead(BUTTONPIN);
digitalWrite(LEDPIN, gameRun);

if (gameRun) {
Serial.println("Start");

for (int i = 0; i < leng[playLevel – 1]; i++) {
delay(level[playLevel – 1][0][i]); // delay sebelum hit
myservo.write(posHit);

delay(level[playLevel – 1][1][i]); // delay tahan tekan di layar
myservo.write(posNetral);

if (i > 10 && !digitalRead(BUTTONPIN)) {
Serial.println("Stop");
digitalWrite(LEDPIN, LOW);
break;
}
}
delay(2000);
}
}
[/code]

Febrianto

Penulis Senior Ndoware.com yang lagi suka ngulik Arduino dan IoT. Hoby bermain game baik itu di komputer, gadget maupun di dunia nyata :)

Tinggalkan Balasan

This site uses Akismet to reduce spam. Learn how your comment data is processed.