Skip to content

Commit

Permalink
Added Source code and assets
Browse files Browse the repository at this point in the history
  • Loading branch information
fixxiefixx committed Jul 10, 2021
0 parents commit 316c923
Show file tree
Hide file tree
Showing 176 changed files with 25,567 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
*.elf
*.elfbin
*.gba

# Save files from emulator
*.sav

/build
/.vscode
/compile_and_run.bat
/tools/TiledMapObjectsToCppHeader/TiledMapObjectsToCppHeader/.vs
/tools/TiledMapObjectsToCppHeader/TiledMapObjectsToCppHeader/TiledMapObjectsToCppHeader/bin
/tools/TiledMapObjectsToCppHeader/TiledMapObjectsToCppHeader/TiledMapObjectsToCppHeader/obj
/make_clean.bat
/generate_mapinfos.bat
/tools/BitmapConverter/BitmapConverter/bin
/tools/BitmapConverter/BitmapConverter/obj
/gba_dev_jam_2021.ss1
31 changes: 31 additions & 0 deletions Credits.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Credits:

This game is made with Butano Engine: https://github.com/GValiente/butano

Programming:

fixx

Graphics:

missingfox, fixx

8x8 font created at Sparklin Labs by Pixel-boy: https://github.com/sparklinlabs/superpowers-asset-packs/blob/master/western-fps-2d/font-8x8.png

Sound:

fixx

hero_attacked.wav sound by InspectorJ(freesound.org)

Music:

sadness music by THE IMPALER: https://modarchive.org/index.php?request=view_by_moduleid&query=167374

forgottenone music vy Zilly Mike https://modarchive.org/index.php?request=view_by_moduleid&query=43235

easter music by anonymous author from https://www.mutopiaproject.org/cgibin/piece-info.cgi?id=442

absolu music by m0d https://modarchive.org/index.php?request=view_by_moduleid&query=32703


46 changes: 46 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#---------------------------------------------------------------------------------------------------------------------
# TARGET is the name of the output.
# BUILD is the directory where object files & intermediate files will be placed.
# LIBBUTANO is the main directory of butano library (https://github.com/GValiente/butano).
# PYTHON is the path to the python interpreter.
# SOURCES is a list of directories containing source code.
# INCLUDES is a list of directories containing extra header files.
# DATA is a list of directories containing binary data.
# GRAPHICS is a list of directories containing files to be processed by grit.
# AUDIO is a list of directories containing files to be processed by mmutil.
# ROMTITLE is a uppercase ASCII, max 12 characters text string containing the output ROM title.
# ROMCODE is a uppercase ASCII, max 4 characters text string containing the output ROM code.
# USERFLAGS is a list of additional compiler flags:
# Pass -flto to enable link-time optimization.
# Pass -O0 to improve debugging.
#
# All directories are specified relative to the project directory where the makefile is found.
#---------------------------------------------------------------------------------------------------------------------
TARGET := $(notdir $(CURDIR))
BUILD := build
LIBBUTANO := ../../butano
PYTHON := python
SOURCES := src src/game_objects
INCLUDES := include include/game_objects
DATA :=
GRAPHICS := graphics
AUDIO := audio
ROMTITLE := ROM TITLE
ROMCODE := SBTP
USERFLAGS := -DBN_CFG_MEMORY_MAX_EWRAM_ALLOC_ITEMS=32
#USERFLAGS := -DBN_CFG_ASSERT_ENABLED=false -flto
EXTTOOL :=

#---------------------------------------------------------------------------------------------------------------------
# Export absolute butano path:
#---------------------------------------------------------------------------------------------------------------------
ifndef LIBBUTANOABS
export LIBBUTANOABS := $(realpath $(LIBBUTANO))
endif



#---------------------------------------------------------------------------------------------------------------------
# Include main makefile:
#---------------------------------------------------------------------------------------------------------------------
include $(LIBBUTANOABS)/butano.mak
Empty file added audio/.gitignore
Empty file.
Binary file added audio/bat.wav
Binary file not shown.
Binary file added audio/collect.wav
Binary file not shown.
Binary file added audio/easter.it
Binary file not shown.
Binary file added audio/fire_bullet.wav
Binary file not shown.
Binary file added audio/forgottenone.xm
Binary file not shown.
Binary file added audio/hero_attacked.wav
Binary file not shown.
Binary file added audio/sadness.xm
Binary file not shown.
Binary file added audio/shield_bounce.wav
Binary file not shown.
Binary file added audio/shortbeep.wav
Binary file not shown.
Binary file added audio/smoke_explosion.wav
Binary file not shown.
Binary file added audio/squisch.wav
Binary file not shown.
Binary file added audio/sword.wav
Binary file not shown.
Binary file added doc/hero_frame_numbers.xcf
Binary file not shown.
Binary file added doc/knight_frame_numbers.xcf
Binary file not shown.
Empty file added graphics/.gitignore
Empty file.
Binary file added graphics/bat.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/bat.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/blob.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/blob.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/blocking_log.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/blocking_log.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/blood_splash.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/blood_splash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/broken_bridge.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/broken_bridge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/builder.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/builder.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/bullet.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/bullet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/chest.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/chest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/cursor.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/cursor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/fireball.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/fireball.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/gbajam_splash.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/gbajam_splash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "regular_bg"
}
Binary file added graphics/heart.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/heart.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/hero.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/hero.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/hero_door_open.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/hero_door_open.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/indoor.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/indoor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "regular_bg"
}
Binary file added graphics/knight.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/knight.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/lumberjack.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/lumberjack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/overworld.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/overworld.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "regular_bg"
}
Binary file added graphics/shadow_small.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/shadow_small.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/smoke_explosion.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/smoke_explosion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/smoke_explosion_small.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/smoke_explosion_small.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/textbox.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/textbox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "regular_bg"
}
Binary file added graphics/title.bmp
Binary file not shown.
3 changes: 3 additions & 0 deletions graphics/title.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "regular_bg"
}
Binary file added graphics/tree_boss.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/tree_boss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Binary file added graphics/tree_boss_minion.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/tree_boss_minion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/variable_8x8_font.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/variable_8x8_font.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 8
}
Binary file added graphics/wood.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/wood.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 16
}
Binary file added graphics/woodboss.bmp
Binary file not shown.
4 changes: 4 additions & 0 deletions graphics/woodboss.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "sprite",
"height": 32
}
Empty file added include/.gitignore
Empty file.
42 changes: 42 additions & 0 deletions include/definitions.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#ifndef DEFINITIONS_H
#define DEFINITIONS_H

enum class Def{
null,
bat,
knight,
chest,
tree_boss_minion,
heart,
heart_container,
hero_house_indoor,
overworld,
hero_house,
hero_house_upstairs,
indoor,
hero_house_downstairs,
cave_left,
hero_house_cave,
cave_bottom,
cave,
hero_house_downstairs2,
hero_house_upstairs2,
chest_cave,
cave2,
lumberjack_house,
builder_house,
coins5,
chest2,
coins10,
bed,
lumberjack,
chest_lumberjach_house,
wood,
builder,
tree_boss,
blocking_log,
blocking_log_vertical,
woodmimic,
broken_bridge
};
#endif
41 changes: 41 additions & 0 deletions include/game_objects/gt_game_object.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#ifndef GT_GAME_OBJECT_H
#define GT_GAME_OBJECT_H

#include "bn_fixed_point.h"
#include "bn_optional.h"
#include "bn_fixed_rect.h"
#include "definitions.h"


namespace gt
{

class game_object
{
public:
virtual ~game_object() = default;
virtual void update();
virtual bn::optional<bn::fixed_point> get_pos();
virtual bn::optional<bn::fixed_rect> get_collision_rect();
virtual void do_damage(int amount);
virtual void interact();
bool is_destroyed();
void destroy();
void mark_as_destroyed();
bool check_map_collision(bn::fixed_point pos);
bool intersects(game_object *other);
bool is_interactive();
bool intersects(const bn::fixed_point &pos);
virtual Def type();

protected:
game_object() = default;
bn::optional<bn::fixed_rect> _local_collision_rect;
bool _is_interactive = false;

private:
bool _is_destroyed = false;
};
}

#endif
47 changes: 47 additions & 0 deletions include/game_objects/gt_go_bat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#ifndef GT_GO_BAT_H
#define GT_GO_BAT_H

#include "bn_sprite_ptr.h"
#include "bn_sprite_actions.h"
#include "bn_sprite_animate_actions.h"
#include "bn_core.h"
#include "bn_fixed_point.h"
#include "gt_game_object.h"
#include "gt_go_enemy.h"


namespace gt
{
class go_bat : public go_enemy
{
public:
go_bat(const bn::camera_ptr& camera);
virtual void update() override;
virtual bn::optional<bn::fixed_point> get_pos() override;
virtual void do_damage(int amount) override;
void set_pos(bn::fixed_point pos);
protected:
virtual void _die() override;
private:
enum class Movestate
{
CIRCLES,
ATTACK,
FLEE
};
void update_circles();
void update_hero_collision();
void update_attack();
bn::sprite_ptr _sprite;
bn::fixed_point _velocity;
bn::sprite_animate_action<6> _action;
bn::fixed _fly_angle;
bool _fly_direction;
uint16_t _fly_time;
Movestate _state;
uint8_t _blinkframes;
};

}

#endif
Loading

0 comments on commit 316c923

Please sign in to comment.