Skip to content

Instantly share code, notes, and snippets.

@thcrack
thcrack / FFXLightningDodger
Created March 9, 2020 04:09
because coding is more fun than getting epilepsy
import ctypes
import time
dc = ctypes.windll.user32.GetDC(0)
SendInput = ctypes.windll.user32.SendInput
# C struct redefinitions
PUL = ctypes.POINTER(ctypes.c_ulong)
class KeyBdInput(ctypes.Structure):
_fields_ = [("wVk", ctypes.c_ushort),
PImage img ;
int r = 10;//size of ecllipse
boolean hasLoadedPixels = false;
void setup () {
size(400, 400) ;
img = loadImage("SpongeBob.jpg") ;
image(img, 0, 0) ;
boolean[][] grid ;
// Number of columns and rows in the grid
int cols = 10 ;
int rows = 10 ;
int cellWidth = 0 ;
int cellHeight = 0 ;
PImage win;
final int GAME_RUN=0,GAME_WIN=1;
int gameState=0;
boolean[][] grid ;
// Number of columns and rows in the grid
int cols = 10 ;
int rows = 10 ;
int cellWidth = 0 ;
int cellHeight = 0 ;
PImage win;
final int GAME_RUN=0,GAME_WIN=1;
int gameState=0;
final int GAME_STOP = 0, GAME_RUN = 1;
int gameState;
int balloonX = 35, balloonY, balloonW = 60, balloonH = 86;
int fireW = 15, fireH = 20;
int cameraOffsetX = 0;
boolean debugMode = false;
PImage bg, balloon, fire;
int hills[] = new int[8];
int hillX[]= new int[8];
final int GAME_STOP = 0, GAME_RUN = 1;
int gameState;
int balloonX = 35, balloonY, balloonW = 60, balloonH = 86;
int fireW = 15, fireH = 20;
int cameraOffsetX = 0;
boolean debugMode = false;
PImage bg, balloon, fire;
int hills[] = new int[8];
PImage bg, start1, start2, lose, win, restart, ship;
final int GAME_START = 0;
final int GAME_RUN = 1;
final int GAME_OVER = 2;
final int GAME_WIN = 3;
int gameState = GAME_START;
final int BUTTON_TOP = 210;
final int BUTTON_BOTTOM = 280;
final int EGG_W = 35;
final int EGG_H = 45;
final int EGG_RANGE = 200;
final int EGG_MIN_X = 25;
final int BASKET_W = 100;
final int BASKET_H = 100;
final int BASKET_Y = 310;
final int BASKET_BOUND = 10;
final int BREAKEGG_W = 70;
final int BREAKEGG_H = 70;
PImage bg, start1, start2, lose, win, restart, ship;
final int GAME_START = 0;
final int GAME_RUN = 1;
int gameState = GAME_START;
final int BUTTON_TOP = 210;
final int BUTTON_BOTTOM = 280;
final int BUTTON_LEFT = 115;
final int BUTTON_RIGHT = 450;
final int EGG_W = 35;
final int EGG_H = 45;
final int EGG_RANGE = 290;
final int EGG_MIN_X = 30;
final int BASKET_W = 100;
final int BASKET_H = 100;
final int BASKET_Y = 310;
PImage bgImg ,basket ,egg;