Browse Source

Fix horizontal movement

master
Forest Belton 3 years ago
parent
commit
86cc17d200
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      gbsdk/rules.mk
  2. +1
    -1
      src/player.c

+ 1
- 1
gbsdk/rules.mk View File

@ -145,7 +145,7 @@ $(BUILD)/level/%.h $(BUILD)/level/%.c: level/%.png level/%_coll.png
@mkdir -p $(BUILD)/level @mkdir -p $(BUILD)/level
@cp $< $(BUILD)/level/ @cp $< $(BUILD)/level/
@cp $(shell dirname $<)/$(shell basename -s .png $<)_coll.png $(BUILD)/level/ @cp $(shell dirname $<)/$(shell basename -s .png $<)_coll.png $(BUILD)/level/
@python3 scripts/generate_map.py --compress 1 "$(BUILD)/$<"
@python3 scripts/generate_map.py "$(BUILD)/$<"
$(BUILD)/assets/%.oam.2bpp: assets/%.oam.png $(BUILD)/assets/%.oam.2bpp: assets/%.oam.png
@echo Converting $< @echo Converting $<

+ 1
- 1
src/player.c View File

@ -42,7 +42,7 @@ void player_update(void) {
} }
} }
if ((joypad_state & PAD_RIGHT) && PLAYER.x + TILE_WIDTH * 2 > SCRN_X) {
if ((joypad_state & PAD_RIGHT) && PLAYER.x + TILE_WIDTH * 2 < SCRN_X) {
PLAYER.dir = DIR_RIGHT; PLAYER.dir = DIR_RIGHT;
PLAYER.x += PLAYER_SPEED; PLAYER.x += PLAYER_SPEED;
if (player_bg_collides()) { if (player_bg_collides()) {

Loading…
Cancel
Save