Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spiders #197

Closed
wants to merge 63 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
8bd49b3
CastielM fixed level 3 not appearing and added constant for total num…
CastielM Apr 17, 2024
cfa4f7e
CastielM added text for controls to HUD
CastielM Apr 17, 2024
5d25791
CastielM added ability to reset current level in case of soft lock (I…
CastielM Apr 17, 2024
0ee17d5
CastielM fixed bug where you couldn't exit game while on the start sc…
CastielM Apr 17, 2024
e7522c1
CastielM changed controls to use WASD which should be consistent with…
CastielM Apr 17, 2024
3dd55dc
CastielM changed start key to be enter instead of space key, which sh…
CastielM Apr 17, 2024
4a90850
CastielM adjusted cost so that password will automatically submit whe…
CastielM Apr 19, 2024
e133c8c
CastielM added password error message. Was keen to add a sound too bu…
CastielM Apr 19, 2024
76b5bc8
adjusted code so screen just sends a check to password.h which is wha…
CastielM Apr 19, 2024
98b3cf9
CastielM fixed so error message displays for more than a split second…
CastielM Apr 19, 2024
931ab6f
CastielM made some adjustments to the way user input calculates where…
CastielM Apr 19, 2024
b66fdd0
CastielM fixed the issue with exit button not working.
CastielM Apr 19, 2024
e8f3bcb
CastielM have changed passwords. EZPZ is now EZPZY, BOSS is now BOSSY…
CastielM Apr 19, 2024
ad3b776
CastielM removed code using C++23 so default compile works
CastielM Apr 20, 2024
02856fb
Merge branch 'thoth-tech:main' into main
CastielM May 1, 2024
baa4307
Compiled Games
invalid-email-address May 1, 2024
2fd60e4
CastielM added .vscode to gitignore
CastielM May 1, 2024
e179183
CastielM renamed test report to remove spaces and and moved into a do…
CastielM May 1, 2024
bff6059
CastielM first step to adding enemies - added basic function for enem…
CastielM May 11, 2024
37e8734
Start of resetting player to middle of board when colliding with enem…
CastielM May 11, 2024
c370253
CastielM Added gemCount to game.cpp and removed gem data from 'player…
CastielM May 11, 2024
eea3af7
CastielM added lives variable, will subtract upon enemy collision. No…
CastielM May 11, 2024
f6e49be
CastielM changed damage noise. added gameover noise and return to men…
CastielM May 11, 2024
77939f5
CastielM removed word 'entirely' from top of file, as code has now be…
CastielM May 11, 2024
fb82671
CastielM added code so that lives is controlled by program.cpp not ga…
CastielM May 11, 2024
2c4d035
CastielM added a few explanatory comments
CastielM May 11, 2024
431fda1
CastielM added code to stop boxes being pushed into enemy
CastielM May 11, 2024
cb3f406
CastielM added a function to prevent boxes being able to be pushed in…
CastielM May 11, 2024
e9b88a3
Fixed bug with position not resetting correctly on enemy collision wi…
CastielM May 11, 2024
9603632
CastielM added gameover message and some small bug fixes/adjustments
CastielM May 11, 2024
ce861df
CastielM added a comment/line of code to make game easier for debuggi…
CastielM May 11, 2024
201b5ec
CastielM added a comment/line of code to make game easier for debuggi…
CastielM May 11, 2024
9e4200b
Castiel adjusted code to allow a variable to control 'easy mode' for …
CastielM May 12, 2024
618a765
CastielM changed fire sound and fixed music not playing after first l…
CastielM May 12, 2024
dd021c2
added a simple win message for last level
CastielM May 12, 2024
e7cdc20
CastielM added new level. Level 0, causing a fault
CastielM May 12, 2024
e65badc
Fixed seg fault issue with the 'remove_gem' function. Was only occuri…
CastielM May 12, 2024
bca48c6
removed added write_lines that were used for debugging the seg fault
CastielM May 12, 2024
bfed74a
moved new level to level 3, moved level 3 to level 4 (thanks for play…
CastielM May 12, 2024
7043346
removed reference to 'back' image that couldn't be found
CastielM May 12, 2024
aca18ff
CastielM reduced game/level win and game over sound effect volumes
CastielM May 12, 2024
7cf6746
CastielM committing as possibly on right track, have some, very buggy…
CastielM May 12, 2024
5d94dba
CastielM fixed enemy/solid collision - spiders now move back and fort…
CastielM May 12, 2024
cbe4c41
CastielM added code to keep enemy x and y ids up to date. Still need …
CastielM May 12, 2024
6afff56
adjusted code for keeping ids up to date and added code to keep track…
CastielM May 12, 2024
b037998
CastielM beginning of fixing box/enemy collision issues
CastielM May 12, 2024
55200fc
CastielM getting closer to fixing collision issues with box/enemy, mo…
CastielM May 12, 2024
0514311
CastielM slight adjustment but don't think it's doing what I'm expecting
CastielM May 12, 2024
1da6d1d
CastielM added some adjustments - works alot better with enemy slowed…
CastielM May 13, 2024
2bd7580
CastielM had to hard reset some work. Have fixed rounding issue thoug…
CastielM May 13, 2024
70d4baa
CastielM fixed issue with sometimes pushing boxes into enemy
CastielM May 13, 2024
f893a8a
Adjusted spider speed and enemy locations on some levels
CastielM May 13, 2024
45d52a4
CastielM removed one of the enemies from level 2
CastielM May 13, 2024
8ccb532
CastielM fixed bug with down and left movements causing boxes to move…
CastielM May 13, 2024
1080c2f
Turned off the debug settings
CastielM May 13, 2024
128741c
CastielM fixed a bug walking through boxes, turns out it wasn't fully…
CastielM May 13, 2024
f0356bc
CastielM keep thinking issue is fixed and it's not! complete disbaned…
CastielM May 13, 2024
bed4672
CastielM added in an adjustment to enemy_move to mitigate spider gett…
CastielM May 14, 2024
41f4529
CastielM removed reference to removed function from header file
CastielM May 14, 2024
4b027d8
CastielM added fix for death sometimes causing boxes to get stranded …
CastielM May 14, 2024
145b312
CastielM adjusted variables regarding level number to make it easier …
CastielM May 14, 2024
116e013
CastielM added comments to assist with navigating code
CastielM May 15, 2024
1cfb8de
CastielM updated config.txt file
CastielM May 15, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
**/[Bb]in/
**/[Oo]bj/
.vscode/
Binary file modified compiled-games/BelowTheSurface/BelowTheSurface-assets.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified compiled-games/BelowTheSurface/BelowTheSurface-win-x86.tar.gz
Binary file not shown.
Binary file modified compiled-games/VentureAdventure/VentureAdventure-assets.tar.gz
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
4 changes: 2 additions & 2 deletions games/BelowTheSurface/level.h
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ class Easy : public Level
this->level_name = "Easy...enough";
shared_ptr<Background> backg(new GreyBackground);
this->background = backg;
this->password = "EZPZ";
this->password = "EZPZY";
this->pre_level_side_text.push_back("Climb to the top...");
this->pre_level_side_text.push_back("Watch out for snakes!");
this->pre_level_image = bitmap_named("level3");
Expand Down Expand Up @@ -643,7 +643,7 @@ class BossLevel : public Level
this->level_name = "Boss Fight";
shared_ptr<Background> backg(new GreyBackground);
this->background = backg;
this->password = "BOSS";
this->password = "BOSSY";
this->pre_level_side_text.push_back("Water Rat is angry!");
this->pre_level_side_text.push_back("...watch out!");
this->pre_level_image = bitmap_named("level9");
Expand Down
82 changes: 61 additions & 21 deletions games/BelowTheSurface/password.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Letter
{
return this->letter_height;
};

};

class Password
Expand All @@ -80,6 +81,7 @@ class Password
vector<std::shared_ptr<Letter>> underscore;
int selection = 0;
int letter = 0;
bool error = false;

public:
Password()
Expand All @@ -97,9 +99,43 @@ class Password
}
};


void incorrect_password()
{
play_sound_effect("BossAttack");
error = true;

//removes one of the letters when password is wrong to prevent endless loop of sound effect
if (letter > 0)
letter -= 2;
underscore[letter]->set_value("_");



};

void draw_error()
{
string error_message = "Try Again";
font font_type = font_named("DefaultFont");
int font_size = 15;
int width = text_width(error_message, font_type, font_size);
point_2d pos = screen_center();
pos.x = pos.x - width / 2;

if (error){
draw_text(error_message, COLOR_RED, font_type, font_size, pos.x, 10);
}
if (!error)
{
draw_text(" ", COLOR_RED, font_type, font_size, pos.x, 10);
}

};

void process_alphabet()
{
string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ<~`";
string alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ<`";
int row = 0;
int col = 0;
int letter_width = 0;
Expand Down Expand Up @@ -131,13 +167,6 @@ class Password
str = "DEL";
pos.y += letter_height * 2;
}
if (str == "~")
{
str = "ENTER";
pos.x -= col * letter_width * 3;
pos.x += col * letter_width * 4;
pos.y += letter_height * 2;
}
if (str == "`")
{
str = "EXIT";
Expand Down Expand Up @@ -193,6 +222,7 @@ class Password
if (key_typed(RIGHT_KEY)) // Orginal Key D_KEY
{
selection += 1;
error = false;

if (selection > keyboard.size() - 1)
selection = 0;
Expand All @@ -201,6 +231,7 @@ class Password
if (key_typed(LEFT_KEY)) // Orginal Key A_KEY
{
selection -= 1;
error = false;

if (selection < 0)
selection = keyboard.size() - 1;
Expand All @@ -209,24 +240,30 @@ class Password
if (key_typed(DOWN_KEY)) // Orginal Key S_KEY
{
selection += 6;
error = false;

if (selection > keyboard.size() - 1)
if (selection >= keyboard.size() - 1)
{
if (selection < 30)
if (selection > 29)
selection = 0 + (selection - 30);
else if (selection > 26)
selection = 27;
else
selection = 0 + (selection - 30);
selection = 26;
}
}

if (key_typed(UP_KEY)) // Orginal Key W_KEY
{
selection -= 6;
error = false;

if (selection < 0)
if (selection <= 0)
{
if (selection < -2)
if (selection < -4)
selection = selection + 30;
else if (selection < -3 )
selection = 26;
else
selection = 27;
}
Expand All @@ -250,14 +287,6 @@ class Password
letter -= 2;
underscore[letter]->set_value("_");
}
else if (select == "ENTER")
{
string temp = "";
for (int i = 0; i < underscore.size(); i += 2)
temp.append(underscore[i]->get_value());

password = temp;
}
else if (select == "EXIT")
{
password = "EXITEXITEXIT";
Expand All @@ -269,6 +298,16 @@ class Password
underscore[letter]->set_value(select);
letter += 2;
}

}
//if last value in the array isn't an underscore anymore, password will automatically try to submit
if (underscore[8]->get_value() != "_")
{
string temp = "";
for (int i = 0; i < underscore.size(); i += 2)
temp.append(underscore[i]->get_value());

password = temp;
}

return password;
Expand All @@ -290,6 +329,7 @@ class Password
string password = input();
draw_element(keyboard);
draw_element(underscore);
draw_error();

return password;
}
Expand Down
13 changes: 11 additions & 2 deletions games/BelowTheSurface/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,8 @@ void PasswordScreen::update()
{
string password = password_screen->update();

write_line(password);

if(password == "EXITEXITEXIT")
{
play_sound_effect("Select");
Expand All @@ -1204,7 +1206,7 @@ void PasswordScreen::update()
{
enter_level(2, screen);
}
else if(password == "EZPZ_")
else if(password == "EZPZY")
{
enter_level(3, screen);
}
Expand Down Expand Up @@ -1232,7 +1234,7 @@ void PasswordScreen::update()
{
enter_level(9, screen);
}
else if(password == "BOSS_")
else if(password == "BOSSY")
{
enter_level(10, screen);
}
Expand All @@ -1244,5 +1246,12 @@ void PasswordScreen::update()
{
enter_level(50, screen);
}
//if password is full and has no underscores, shows error message
else if(password.length() == 5 && password.find('_') == std::string::npos)
{

password_screen->incorrect_password();
}

}
}
Binary file modified games/VentureAdventure/.vscode/.BROWSE.VC.DB
Binary file not shown.
Binary file not shown.
Binary file added games/VentureAdventure/.vscode/.BROWSE.VC.DB-wal
Binary file not shown.
7 changes: 6 additions & 1 deletion games/VentureAdventure/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@
"CHERE_INVOKING": "enabled_from_arguments"
},
"terminal.integrated.shell.windows": "C:/msys64/usr/bin/bash.exe",
"terminal.integrated.shellArgs.windows": ["--login"],
"terminal.integrated.shellArgs.windows": [
"--login"
],
"files.associations": {
"fstream": "cpp"
},
}
7 changes: 5 additions & 2 deletions games/VentureAdventure/Resources/animations/spider.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ f:[18-20],[18-20],10,18
//f:[21-23],[21-23],10,21

//vectors
//2nd and 3rd numbers in these sequences indicate the change in x and y position that the sprite changes each frame. Can be used to adjust enemy movement speed
//For animation frame speed, refer to DUR above
v:[0-2],0,4
v:[6-8],-4,0
v:[12-14],4,0
v:[6-8],-0.8,0
v:[12-14],0.8,0
v:[18-20],0,-4
v:40,0,0
v:41,0,0
v:42,0,0
v:43,0,0


//identifiers
i:w_down,0
i:w_left,6
Expand Down
23 changes: 17 additions & 6 deletions games/VentureAdventure/Resources/bundles/icons.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Tiles & Art
BITMAP,tiles,forest_tiles.png
BITMAP,back,back.jpg
BITMAP,stairs,stairs.png
BITMAP,fire,fire.png
BITMAP,title,title.png
BITMAP,entry,ground_tiles.png

// Sprite
//BITMAP,hero,hero7.png
Expand All @@ -14,29 +14,40 @@ BITMAP,box4,box4.png
// Sounds
SOUND,diamond,diamond.wav
SOUND,win,win.mp3
SOUND,damage,damage2.wav
SOUND,game_over,game_over.mp3
SOUND,light_fire,lightfire.wav


// Programming, Game Design & Development by Anthony George
// Modifications by Deakin University SIT374 AND SIT378 Adv Game Dev Team

// Game Music by Michael George

// Hero Attribution
// Curt - cjc83486 - https://opengameart.org/content/rpg-character

// Tile Art Attribution
//
// https://opengameart.org/content/lpc-forest-tiles
// Leonard Pabin - https://opengameart.org/users/leonard-pabin

// Spider Art Attribution
// Tuomo Untinen

// Sound - diamond
// DrMinky - https://freesound.org/s/166184/

// Sound - stairs
// thejoshuachang - https://freesound.org/people/thejoshuachang/sounds/203081/
// Sound - lightfire
// Pixabay - https://pixabay.com/sound-effects/torchlitthenblownout-42805/

// Sound - game_over
// Pixabay - https://pixabay.com/sound-effects/videogame-death-sound-43894/

// Sound - damage, damage2 (May 2024)
// CastielM

// Music
// Two Finger Johnny by Kevin MacLeod
// Link: https://incompetech.filmmusic.io/song/5008-two-finger-johnny
// Link: https://incompetech.com/wordpress/2015/01/two-finger-johnny/
// License: http://creativecommons.org/licenses/by/4.0/

Binary file added games/VentureAdventure/Resources/images/fire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion games/VentureAdventure/Resources/levels/level1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
30 50 50 50 0 0 1 0 1 1 1 1 0 0 0 30
14 0 1 1 1 0 1 0 300 1 400 0 0 0 200 14
30 0 0 0 0 53 53 1 1 300 300 0 50 0 50 30
14 300 50 50 300 53 0 300 1 1 0 50 27 27 27 14
14 300 50 50 300 53 0 300 84 1 0 50 27 27 27 14
30 0 400 28 0 0 400 300 1 0 0 0 300 0 0 30
14 0 0 300 0 0 0 300 1 0 400 0 27 400 27 14
30 0 0 0 50 50 50 0 1 0 55 56 300 300 50 30
Expand Down
8 changes: 4 additions & 4 deletions games/VentureAdventure/Resources/levels/level2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
30 300 300 50 0 0 1 0 1 1 1 1 27 27 27 30
14 0 1 0 1 50 27 27 27 0 27 27 27 400 27 14
30 50 0 0 50 400 27 0 1 0 27 400 27 0 27 30
14 400 0 50 0 0 300 0 0 1 0 0 300 0 0 14
14 400 0 50 0 0 300 0 84 1 0 0 300 0 0 14
30 50 0 0 50 400 27 0 1 0 27 0 27 0 27 30
14 0 0 0 0 50 27 27 27 27 0 0 27 0 27 14
30 200 0 50 0 0 0 0 1 50 0 27 0 0 27 30
14 200 0 0 0 50 27 27 27 27 0 0 27 0 27 14
30 0 0 50 0 0 0 0 1 50 0 27 0 0 27 30
14 0 0 0 0 1 50 1 1 0 300 27 1 27 400 14
30 0 50 400 50 0 400 0 0 0 0 1 1 0 0 30
14 400 0 1 1 1 0 0 200 0 50 27 27 27 400 14
14 400 0 1 1 1 0 0 0 0 50 27 27 27 400 14
30 43 44 43 44 43 44 43 44 43 44 43 44 43 44 30
30 changes: 15 additions & 15 deletions games/VentureAdventure/Resources/levels/level3.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
14 43 44 43 44 43 44 43 44 43 44 43 44 43 44 14
30 400 0 1 1 0 0 0 0 0 0 0 0 0 400 30
14 1 27 27 27 300 50 400 50 300 27 400 27 0 0 14
30 1 1 27 0 0 50 50 50 0 400 27 400 0 0 30
14 0 0 27 0 0 50 400 50 1 27 400 27 0 0 14
30 0 0 0 0 0 1 0 1 1 1 1 0 0 0 30
14 0 53 1 53 0 1 0 0 1 0 116 117 118 400 14
30 0 53 400 53 0 55 56 1 0 0 132 133 134 400 30
14 0 53 53 53 0 0 0 1 1 0 148 149 150 400 14
30 0 0 0 53 0 0 0 1 0 0 0 0 0 0 30
14 0 0 0 300 0 0 0 1 0 0 0 0 0 0 14
30 27 27 27 0 50 0 300 1 27 0 0 50 0 50 30
14 27 200 27 0 50 300 1 27 0 27 0 50 400 50 14
30 27 27 27 1 50 0 0 27 27 27 0 1 50 0 30
14 27 400 1 1 50 50 400 27 0 27 400 400 50 0 14
30 43 44 43 44 43 44 43 44 43 44 43 44 43 44 30
30 400 0 27 0 0 300 400 400 400 400 0 200 76 77 30
14 53 0 0 0 0 0 55 56 50 0 50 300 92 93 14
30 400 53 0 0 0 0 0 50 0 0 0 0 50 50 30
14 0 50 55 56 0 0 0 0 50 50 300 300 0 400 14
30 0 0 50 200 0 400 0 0 0 0 0 0 0 0 30
14 0 300 0 0 0 50 0 0 0 0 300 27 0 0 14
30 0 0 300 0 0 0 0 0 0 27 400 0 0 0 30
14 0 50 400 0 0 0 0 84 0 119 120 121 0 0 14
30 0 76 77 0 0 0 0 0 0 135 136 137 27 400 30
14 0 92 93 50 0 0 50 0 0 151 152 153 0 28 14
30 400 0 200 78 0 0 0 0 0 50 0 27 300 400 30
96 97 96 97 94 0 0 0 0 28 0 300 0 0 50 14
98 99 98 99 97 400 50 0 0 300 0 0 0 187 27 30
114 115 114 115 113 50 400 0 53 0 0 28 0 0 400 14
98 99 98 99 97 43 44 43 44 43 44 43 44 43 44 30
16 changes: 16 additions & 0 deletions games/VentureAdventure/Resources/levels/level4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
14 43 44 43 44 43 44 43 44 43 44 43 44 43 44 14
30 400 0 1 1 0 0 0 0 0 0 0 0 0 400 30
14 1 27 27 27 300 50 400 50 300 27 400 27 0 0 14
30 1 1 27 0 0 50 50 50 0 400 27 400 0 0 30
14 0 0 27 0 0 50 400 50 1 27 400 27 0 0 14
30 0 0 0 0 0 1 0 1 1 1 1 0 0 0 30
14 0 53 1 53 0 1 0 0 1 0 116 117 118 400 14
30 0 53 400 53 0 55 56 1 0 0 132 133 134 400 30
14 0 53 53 53 0 0 0 84 1 0 148 149 150 400 14
30 0 0 0 53 0 0 0 1 0 0 0 0 0 0 30
14 0 0 0 300 0 0 0 1 0 0 0 0 0 0 14
30 27 27 27 0 50 0 300 1 27 0 0 50 0 50 30
14 27 1 27 0 50 300 1 27 0 27 0 50 400 50 14
30 27 27 27 1 50 0 0 27 27 27 0 1 50 0 30
14 27 400 1 1 50 50 400 27 0 27 400 400 50 0 14
30 43 44 43 44 43 44 43 44 43 44 43 44 43 44 30
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Loading