Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMelenchon committed Dec 29, 2019
2 parents ab77344 + 3d40097 commit 35208e1
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 15 deletions.
Binary file modified Game/audio/fx/1up.wav
Binary file not shown.
6 changes: 3 additions & 3 deletions Game/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<scene>
<mapFadeTime>1.f</mapFadeTime>
<startingLifes>1</startingLifes>
<maxScore value="3500" />
<maxScore value="16080" />
<click file="audio/fx/click.wav" />
</scene>
<main_menu>
Expand All @@ -34,8 +34,8 @@
<map>
<folder>maps/</folder>
<level name="intro.tmx" />
<level name="map1.tmx" />
<level name="map2.tmx" />
<level name="map1.tmx" />
<level name="map2.tmx" />
<intro name="menu.tmx" />
</map>
<audio>
Expand Down
2 changes: 1 addition & 1 deletion Motor2D/j1MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void j1MainMenu::OnGui(UIEventType type, UIFunction func, j1UIelement* userPoint

case UIFunction::FNC_GITHUB:
{
ShellExecuteA(NULL, "open", "https://github.com/AlexMelenchon/BouncySlime-XMatSigma", NULL, NULL, SW_SHOWNORMAL);
ShellExecuteA(NULL, "open", "https://alexmelenchon.github.io/BouncySlime-XMatSigma/", NULL, NULL, SW_SHOWNORMAL);
}
break;
case UIFunction::FNC_EXIT:
Expand Down
1 change: 1 addition & 0 deletions Motor2D/j1Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ bool j1Player::Start()
congratsFx.id = App->audio->LoadFx(congratsFx.path.GetString());
loseFx.id = App->audio->LoadFx(loseFx.path.GetString());
coinFx.id = App->audio->LoadFx(coinFx.path.GetString());
lifeFx.id = App->audio->LoadFx(lifeFx.path.GetString());


return true;
Expand Down
26 changes: 18 additions & 8 deletions Motor2D/j1Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool j1Scene::Awake(pugi::xml_node& scene_config)
//Var load------------
mapFadeTime = scene_config.child("mapFadeTime").text().as_float();
startingLifes = scene_config.child("startingLifes").text().as_uint(3);
maxScore = scene_config.child("maxScore").attribute("value").as_uint(4500);
maxScore = scene_config.child("maxScore").attribute("value").as_uint();
click.path = scene_config.child("click").attribute("file").as_string();

//Command creation--------
Expand Down Expand Up @@ -89,11 +89,15 @@ bool j1Scene::Start()
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 244,10 }, false, false, true, { 1257,605,65,64 });
ui_coins = App->ui->AddElement(ui_type::UI_TEXT, nullptr, { 314,30 }, false, false, true, { 0,0,0,0 }, nullptr, UIFunction::FNC_NONE, drag_axis::MOV_NONE, "00");
//Score
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 394,10 }, false, false, true, { 144,922,65,64 });
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 394,10 }, false, false, true, { 144,922,65,64 });
ui_score = App->ui->AddElement(ui_type::UI_TEXT, nullptr, { 464,30 }, false, false, true, { 0,0,0,0 }, nullptr, UIFunction::FNC_NONE, drag_axis::MOV_NONE, "00000");
//Max Score
sprintf_s(maxScore_text, 10, "%05d", maxScore);
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 574,10 }, false, false, true, { 738,702,65,64 });
ui_maxScore = App->ui->AddElement(ui_type::UI_TEXT, nullptr, { 644,30 }, false, false, true, { 0,0,0,0 }, nullptr, UIFunction::FNC_NONE, drag_axis::MOV_NONE, maxScore_text);
//Time
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 594,10 }, false, false, true, { 737,478,64,64 });
ui_time = App->ui->AddElement(ui_type::UI_TEXT, nullptr, { 664,30 }, false, false, true, { 0,0,0,0 }, nullptr, UIFunction::FNC_NONE, drag_axis::MOV_NONE, "00000");
App->ui->AddElement(ui_type::UI_IMAGE, nullptr, { 744,10 }, false, false, true, { 737,478,64,64 });
ui_time = App->ui->AddElement(ui_type::UI_TEXT, nullptr, { 814,30 }, false, false, true, { 0,0,0,0 }, nullptr, UIFunction::FNC_NONE, drag_axis::MOV_NONE, "00000");

//Console Init------
App->ui->AddElement(ui_type::UI_CONSOLE, nullptr, { 0,0 }, true, false, false, { 0,0,0,0 }, this, UIFunction::FNC_NONE, drag_axis::MOV_NONE);
Expand Down Expand Up @@ -350,7 +354,7 @@ bool j1Scene::Load(pugi::xml_node& load)

//Load the gameplay related vars-------------
lifes = load.child("current_lifes").attribute("value").as_uint();
score = load.child("current_score").attribute("value").as_uint();
score = load.child("current_score").attribute("value").as_uint();
coins = load.child("current_coins").attribute("value").as_uint();
time.StartFrom(load.child("current_time").attribute("value").as_int());

Expand Down Expand Up @@ -720,10 +724,16 @@ bool j1Scene::CheckMaxScore()
max_score.attribute("value").set_value(score);
maxScore = score;

//UI update------------------------------------
App->tex->UnLoad(ui_maxScore->texture);
ui_maxScore->texture = nullptr;
sprintf_s(maxScore_text, 10, "%05d", maxScore);
ui_maxScore->texture = App->fonts->Print(maxScore_text);
App->fonts->CalcSize(maxScore_text, ui_maxScore->rect.w, ui_maxScore->rect.h);

App->saveConfigFile();
}


return ret;
}

Expand Down Expand Up @@ -760,9 +770,9 @@ void j1Scene::CoinUp()
if (coins % 10 == 0)
{
lifes++;
//TODO: LIFE UP SFX
App->audio->PlayFx(App->entities->player->lifeFx.id);
App->scene->UIInGameUpdate();
}

App->audio->PlayFx(App->entities->player->coinFx.id);
}
}
2 changes: 2 additions & 0 deletions Motor2D/j1Scene.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,14 @@ class j1Scene : public j1Module
j1UIelement* ui_lifes = nullptr;
j1UIelement* ui_coins = nullptr;
j1UIelement* ui_score = nullptr;
j1UIelement* ui_maxScore = nullptr;
j1UIelement* ui_time = nullptr;

//Text to blit into screen
char lifes_text[2];
char coins_text[2];
char score_text[5];
char maxScore_text[5];
char time_text[10];

//--------INTERNAL CONTROL---------//
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,15 @@ David Carrasquet Iniesta:
https://freesound.org/people/marchon11/sounds/493224/
https://freesound.org/people/DWOBoyle/sounds/144266/

Coin fx:
https://freesound.org/people/ProjectsU012/sounds/341695/

Click fx:
https://freesound.org/people/kwahmah_02/sounds/256116/

Win fx:
https://freesound.org/people/LittleRobotSoundFactory/

## License:
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
You can check the full license in our project
Expand Down
38 changes: 35 additions & 3 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ You'll have to prove yourself parkouring through the world and get your reward t

<table>
<tr>
<td> <a href="https://github.com/davidcarrasquet">David Carrasquet</a></td>
<td> <a href="https://github.com/davidcarrasquet">David Carrasquet</a></td>
<td> <em>Main design and code</em></td>
<td> <img src="https://github.com/AlexMelenchon/BouncySlime-XMatSigma/blob/master/docs/david.png?raw=true"> </td>
</tr>
<tr>
<td><a href="https://github.com/AlexMelenchon">Àlex Melenchón</a></td>
<td><a href="https://github.com/AlexMelenchon">Àlex Melenchón</a></td>
<td><em>Main code and design</em></td>
<td> <img src="https://github.com/AlexMelenchon/BouncySlime-XMatSigma/blob/master/docs/alex.png?raw=true"> </td>
</tr>
</table>
Expand Down Expand Up @@ -64,9 +66,34 @@ You'll have to prove yourself parkouring through the world and get your reward t

## Console comands

+ <strong>º/ª:</strong> Open the In-Game Console (only while in the mid of a level)
+ <strong>Left Arrow:</strong> Positions cursor one letter to the left
+ <strong>Right Arrow:</strong> Positions cursor one letter to the right
+ <strong>Backspace:</strong> Deletes one letter in the left of the cursor position
+ <strong>Supr:</strong> Deletes one letter in the right of the cursor position
+ <strong>Enter:</strong> Enters a command into the console
_Enter the command 'list' in the console to see a list of all avaliable commands_


# Quick description of the system

This 2D platformer is a game made with SDL with the integration of pugui::xml for loading/saving. Entities and UI work with the structure of an entity system.

# Innovations

_innovations are features that weren't needed as a requirement for our assigments_

- Volume control in-game
- Forward-propagation collision system, colliders are loaded from an object layer of the tmx
- Camera culling with parallax
- Animations load from XML document
- Music loads from tmx
- Enemies have a default patrol movement, if they are not chasing the player, they do a patrol
- Enemies make pathfinding to their patrol when they stop chasing the player
- Player has a cooldown ability, a shuriken throw. When thrown, tha player can't throw another one until it comes back to him with pathfinding.
- Land enemies have "intelligent" jump method, they will chase the player and jump whe they are able to make a succesful jump.
- Game can be paused with "p".
- Enemies and their patrol load from tmx.

# Credits

Expand All @@ -83,6 +110,8 @@ You'll have to prove yourself parkouring through the world and get your reward t
## Music

Loop musics by: <a href="https://soundcloud.com/pascalbelisle">Pascal Belisle</a>

Kahoot music by: <a href="https://kahoot.com/library/kahoot-sheet-music/">Alf Inge Wang</a>

Sound effects by: Nintendo, ripped by <a href="https://www.sounds-resource.com/wii/ssbb/">Sound-Resource</a>

Expand All @@ -92,7 +121,10 @@ You'll have to prove yourself parkouring through the world and get your reward t

Coin fx: <a href="https://freesound.org/people/ProjectsU012/sounds/341695/">ProjectsU012</a>

Click fx: <a href="https://freesound.org/people/kwahmah_02/sounds/256116/">kwahmah_02</a>
Click fx: <a href="https://freesound.org/people/kwahmah_02/sounds/256116/">kwahmah_02</a>

Win fx: <a href="https://freesound.org/people/LittleRobotSoundFactory/">LittleRobotSoundFactory</a>



# License
Expand Down

0 comments on commit 35208e1

Please sign in to comment.