mirror of
https://github.com/BreizhHardware/bloubloulespoissons.git
synced 2026-01-18 16:47:31 +01:00
Try to detach the camera and compile for 3DS
This commit is contained in:
26
Makefile
Normal file
26
Makefile
Normal file
@@ -0,0 +1,26 @@
|
||||
# DevkitPro and DevkitARM path
|
||||
DEVKITPRO ?= /opt/devkitpro
|
||||
DEVKITARM ?= $(DEVKITPRO)/devkitARM
|
||||
|
||||
# Project name
|
||||
TARGET := bloubloulespoissons
|
||||
BUILD := build
|
||||
SOURCES := .
|
||||
INCLUDES := .
|
||||
|
||||
# Libraries
|
||||
LIBS := -lSDL2 -lSDL2_image -lSDL2_ttf
|
||||
|
||||
# Compiler and linker settings
|
||||
ARCH := -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft
|
||||
CFLAGS := -g -O2 -Wall -mword-relocations $(ARCH) -I$(DEVKITPRO)/libctru/include -I$(INCLUDES)
|
||||
LDFLAGS := -L$(DEVKITPRO)/libctru/lib $(LIBS)
|
||||
|
||||
# Rules
|
||||
all: $(BUILD)/$(TARGET).3dsx
|
||||
|
||||
$(BUILD)/$(TARGET).3dsx: $(BUILD)/$(TARGET).elf
|
||||
3dsxtool $(BUILD)/$(TARGET).elf $@
|
||||
|
||||
$(BUILD)/$(TARGET).elf: $(SOURCES)/*.cpp
|
||||
$(DEVKITARM)/bin/arm-none-eabi-g++ $(CFLAGS) -o $@ $^ $(LDFLAGS)
|
||||
10
main.cpp
10
main.cpp
@@ -249,12 +249,18 @@ void handleEvents(int& playerX, int& playerY, const int playerSpeed) {
|
||||
Camera& camera = Camera::getInstance();
|
||||
|
||||
if (keystate[SDL_SCANCODE_W]) {
|
||||
if(camera.getY() > -playerBaseY) {
|
||||
if (playerY > 0) {
|
||||
playerY -= playerSpeed;
|
||||
}
|
||||
if (camera.getY() > 0 && playerY < playerBaseY) {
|
||||
camera.move(0, -playerSpeed);
|
||||
}
|
||||
}
|
||||
if (keystate[SDL_SCANCODE_S]) {
|
||||
if(camera.getY() < ENV_HEIGHT - windowHeight) {
|
||||
if (playerY < ENV_HEIGHT - 75) {
|
||||
playerY += playerSpeed;
|
||||
}
|
||||
if (camera.getY() < ENV_HEIGHT - windowHeight && playerY > playerBaseY) {
|
||||
camera.move(0, playerSpeed);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user