Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 34 additions & 32 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# 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
# 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

.vscode/
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Arcade Games Hackathon-in-a-Box

This repo will be used in the Arcade Games "Hackathon-in-a-box" event.

games/cpp_games/SpaceExplorer
Empty file.
41 changes: 0 additions & 41 deletions games/cpp_games/LostInSpace/program.cpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ BITMAP,box,box.png
BITMAP,empty,empty.png
BITMAP,full,full.png
ANIM,coins,coin_animation.txt
// Our additions
BITMAP,wormhole,Wormhole.png
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BITMAP, Company2, companylogo1.png
BITMAP, Company1, companylogo2.png
FONT, DefaultFont, DefaultFont.ttf
BITMAP, TeamLogo, teamlogo.png
BITMAP, Button, button.png
BITMAP, MenuBg, menubackground.png
BITMAP, Title, title.png
SOUND, Select, Select.wav
BITMAP, GameOver, GameOver.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
68 changes: 68 additions & 0 deletions games/cpp_games/SpaceExplorer/button.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include "splashkit.h"

/*
ADAPTED FROM BELOW THE SURFACE
DO NOT TOUCH, IT WORKS AND THAT'S ALL IT NEEDS TO DO
DO NOT DELETE THE FILE, IT IS A PREREQ FOR THE SCREEN HEADER AND MENU TO WORK CORRECTLY.
*/

class Button
{
protected:
bitmap button_bmp;
point_2d position;
int id;
string text;
font button_font;
int font_size = 25;
bool selected = false;
color font_color = COLOR_BLACK;
color selected_color = COLOR_YELLOW;

public:
Button(bitmap button_bmp, int offset, int id, string text)
{
this->button_bmp = button_bmp;
this->id = id;
this->text = text;
this->button_font = font_named("DefaultFont");
point_2d pt = screen_center();
position.x = pt.x - bitmap_width(this->button_bmp)/2;
position.y = pt.y - bitmap_height(this->button_bmp)/2 + offset;
};
~Button(){};

void draw()
{
color text_color;
point_2d center = bitmap_center(this->button_bmp);
draw_bitmap(button_bmp, position.x, position.y, option_to_screen());
if(!selected)
text_color = font_color;
else
text_color = selected_color;

draw_text(text, text_color, button_font, font_size, (center.x + position.x) - text_width(text, button_font, font_size)/2, (center.y + position.y) - text_height(text, button_font, font_size)/2, option_to_screen());
};

void set_selected(bool new_value)
{
this->selected = new_value;
}

int get_id()
{
return this->id;
}
};

class SmallButton : public Button
{
public:
SmallButton(bitmap button_bmp, int offset, int id, string text, int font_size, color font_color, color selected_color) : Button(button_bmp, offset, id, text)
{
this->font_size = font_size;
this->font_color = font_color;
this->selected_color = selected_color;
}
};
46,861 changes: 46,861 additions & 0 deletions games/cpp_games/SpaceExplorer/logs/splashkit.log

Large diffs are not rendered by default.

Loading