Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tomascarreras1000 committed Apr 20, 2020
2 parents 9fea210 + b3d8e2e commit 59b9e88
Show file tree
Hide file tree
Showing 5 changed files with 108 additions and 73 deletions.
Binary file not shown.
Binary file modified PaintWars/Project_II_Game/Game/textures/UI/UI_atlas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 18 additions & 15 deletions PaintWars/Project_II_Game/Motor2D/GameScene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,16 +334,17 @@ bool GameScene::Start()
buyHouseButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, shopImage, { 210, 485 }, { 0,0 }, true, false, { 1985, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
buyHouseButton->hover_rect = { 0, 1966, 65, 82 };
buyHouseButton->click_rect = { 65, 1966, 65, 82 };
upgradeWoodProducerButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 15, 567 }, { 0,0 }, true, true, { 325, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradeWoodProducerButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 15, 567 }, { 0,0 }, true, false, { 1985, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradeWoodProducerButton->hover_rect = { 0, 1966, 65, 82 };
upgradeWoodProducerButton->click_rect = { 65, 1966, 65, 82 };
upgradePaintExtractorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 80, 567 }, { 0,0 }, true, true, { 325, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradePaintExtractorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 80, 567 }, { 0,0 }, true, false, { 1985, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradePaintExtractorButton->hover_rect = { 0, 1966, 65, 82 };
upgradePaintExtractorButton->click_rect = { 65, 1966, 65, 82 };


//HUD - MiniMap

miniMapBackground = App->gui->AddElement(TypeOfUI::GUI_IMAGE, nullptr, { 850 , 500 }, { 0 , 0 }, false, true, { 0, 1670, 422, 210 }, nullptr, nullptr, TEXTURE::ATLAS_SPRITE);
miniMapBackground = App->gui->AddElement(TypeOfUI::GUI_IMAGE, nullptr, { 850 , 500 }, { 0 , 0 }, false, true, { 0, 1750, 422, 210 }, nullptr, nullptr, TEXTURE::ATLAS_SPRITE);

miniMapMINI = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 850 , 500 }, { 0,0 }, true, true, { 30, 15, 422,210 }, nullptr, App->scenes, TEXTURE::MINIMAP_MINI);
miniMapMINI->click_rect = { 30, 15, 422,210 };
Expand All @@ -360,18 +361,18 @@ bool GameScene::Start()

//Buildings

buyPainterButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 210, 485 }, { 0,0 }, true, true, { 130, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
buyPainterButton->hover_rect = { 390, 1966, 65, 82 };
buyPainterButton->click_rect = { 750, 1966, 65, 82 };
upgradePainterButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 275, 485 }, { 0,0 }, true, true, { 260, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradePainterButton->hover_rect = { 520, 1966, 65, 82 };
upgradePainterButton->click_rect = { 780, 1966, 65, 82 };
buyWarriorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 210, 485 }, { 0,0 }, true, true, { 195, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
buyWarriorButton->hover_rect = { 455, 1966, 65, 82 };
buyWarriorButton->click_rect = { 715, 1966, 65, 82 };
upgradeWarriorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 210, 485 }, { 0,0 }, true, true, { 325, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradeWarriorButton->hover_rect = { 585, 1966, 65, 82 };
upgradeWarriorButton->click_rect = { 845, 1966, 65, 82 };
upgradePainterButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 80, 485 }, { 0,0 }, true, true, { 130, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradePainterButton->hover_rect = { 390, 1966, 65, 82 };
upgradePainterButton->click_rect = { 750, 1966, 65, 82 };
buyPainterButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 15, 485 }, { 0,0 }, true, true, { 260, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
buyPainterButton->hover_rect = { 520, 1966, 65, 82 };
buyPainterButton->click_rect = { 780, 1966, 65, 82 };
upgradeWarriorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 80, 485 }, { 0,0 }, true, true, { 195, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
upgradeWarriorButton->hover_rect = { 455, 1966, 65, 82 };
upgradeWarriorButton->click_rect = { 715, 1966, 65, 82 };
buyWarriorButton = App->gui->AddElement(TypeOfUI::GUI_BUTTON, nullptr, { 15, 485 }, { 0,0 }, true, true, { 325, 1966, 65, 82 }, nullptr, App->scenes, TEXTURE::ATLAS, FONT::FONT_SMALL, 6);
buyWarriorButton->hover_rect = { 585, 1966, 65, 82 };
buyWarriorButton->click_rect = { 845, 1966, 65, 82 };



Expand Down Expand Up @@ -721,6 +722,8 @@ void GameScene::GUI_Event_Manager(GUI_Event type, j1UIElement* element)
buyPaintExtractorButton->enabled = !buyPaintExtractorButton->enabled;
buyBarrackButton->enabled = !buyBarrackButton->enabled;
buyHouseButton->enabled = !buyHouseButton->enabled;
upgradeWoodProducerButton->enabled = !upgradeWoodProducerButton->enabled;
upgradePaintExtractorButton->enabled = !upgradePaintExtractorButton->enabled;
}

if (element == buyPaintExtractorButton && type == GUI_Event::EVENT_ONCLICK) {
Expand Down
6 changes: 4 additions & 2 deletions PaintWars/Project_II_Game/Motor2D/GameScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class GameScene : public Scene

public:
//void InitScene(); // Method that will be used to initialize all scene elements.

//void DrawScene(); // Method that will draw all scene elements on screen.
//SDL_Texture* SceneToTexture(); // Method that will be used to get a texture from the current screen.

Expand All @@ -63,7 +63,7 @@ class GameScene : public Scene
bool Change_Map;



//////////////////
// UI //
//////////////////
Expand Down Expand Up @@ -142,6 +142,8 @@ class GameScene : public Scene
j1UIElement* buyWoodProducerButton = nullptr;
j1UIElement* buyBarrackButton = nullptr;
j1UIElement* buyHouseButton = nullptr;
j1UIElement* upgradePaintExtractorButton = nullptr;
j1UIElement* upgradeWoodProducerButton = nullptr;


// Buildings
Expand Down
142 changes: 86 additions & 56 deletions PaintWars/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PAINT WARS
# PAINT WARS
## by BrainDead Studios

## Description
Expand All @@ -17,7 +17,7 @@ In a world full of colour, a corruption spread, turning everything monochromatic
- GENERAL
+ Logo for the team
+ Logo for the game
+ FX for the Game Logo
+ FX for the Game Logo and Team Logo
+ Social Media Updated
+ Animations
+ Game resoulution at 1280x720px@60fps (Window and Full Screen supported)
Expand Down Expand Up @@ -59,37 +59,60 @@ In a world full of colour, a corruption spread, turning everything monochromatic
- AUDIO
+ Background music implemented for all the scenes
+ UI feedback
+ FX (warrior attack, spawner destroyed)
+ FX
1 - warrior attack
2 - spawner destroyed
3 - painter movement
4 - warrior movement
5 - buying from shop
6 - timer (when 10 sec left, countdown every second)
7 - wood producer
8 - town hall when creating a painter
9 - barracks when creating a warrior
10 - birds
11 - crickets

- paint extractor
- painter collecting

+ Positioning (further fx sound less)
- DEBUG
+ F2 Game Scene
+ F4 Save
+ F5 Load (Load function not functional yet)
+ F6 Full Screen
+ F7 Direct Win
+ F8 Direct Lose
+ F9 Collisions
+ F10 God Mode (add resources, buildings and units, can't lose, collisions)
resources
- 1 add 10 paint
- 2 add 10 wood
- 3 add 10 metal scrap -not implemented yet-
- 4 add 10 titanium -not implemented yet-
- 5 add 10 food -not implemented yet-
- 6 add 10 max housing
- 7 add 1 level of research (units will have the upgrades already)
units (on mouse position)
- KP 1 add painter
- KP 2 add warrior
- KP 3 add ranged -not implemented yet-
- KP 4 add tank -not implemented yet-
- KP 5 add explorer -not implemented yet-
- KP 0 kill selected unit
buildings (on mouse position)
- Crtl + KP 1 add paint extractor
- Crtl + KP 2 add wood producer
- Crtl + KP 3 add barracks
- Crtl + KP 4 add house
+ F2/F3 Game Scene
+ F4 Save
+ F5 Load (Load function not functional yet)
+ F6 Full Screen
+ F7 Direct Win
+ F8 Direct Lose
+ F9 Collisions
+ F10 God Mode (add resources, buildings and units, can't lose, collisions)
resources
- 1 add 10 paint
- 2 add 10 wood
- 3 add 10 metal scrap -not implemented yet-
- 4 add 10 titanium -not implemented yet-
- 5 add 10 food -not implemented yet-
- 6 add 10 max housing
- 7 add 1 level of research (units will have the upgrades already)
units (on mouse position)
- KP 1 add painter
- KP 2 add warrior
- KP 3 add ranged -not implemented yet-
- KP 4 add tank -not implemented yet-
- KP 5 add explorer -not implemented yet-
- KP 0 kill selected units
buildings (on mouse position)
- Crtl + KP 1 add paint extractor
- Crtl + KP 2 add wood producer
- Crtl + KP 3 add barracks
- Crtl + KP 4 add house
- Crtl + KP 0 kill selected buildings
+ H Go to Town Hall
+ P Pause
+ S/L Save/Load (only save implemented)
+ ESC exit game (not in game scene)
+ N/M/R Zoom In/Out/Reset
+ KP MINUS/KP PLUS Control Framerate (+/- 10)
+ UP/DOWN/LEFT/RIGHT Camera movement


## Controls
Expand All @@ -102,7 +125,6 @@ From the shop, you can get different buiuldings:
+ house (built with wood): to increase your max number of units
+ barracks (built with wood): to create warriors
Warriors are used to attack the spawners and destroy them to win the game.
You can also upgrade units and some buildings.

- LEFT CLICK - select
- RIGHT CLICK - select destination / attack
Expand All @@ -112,34 +134,42 @@ You can also upgrade units and some buildings.
- UI and HUD - each button is self-explanatory, right clicking to select and hover enabled
+ SHOP - to shop, click on the "Shop Button", and select what you want to build by dragging into the map, it will take a while to build (depending on research level)
- DEBUG
+ F2 Game Scene
+ F2/F3 Game Scene
+ F4 Save
+ F5 Load (Load function not functional yet)
+ F6 Full Screen
+ F7 Direct Win
+ F8 Direct Lose
+ F9 Collisions
+ F10 God Mode (add resources, buildings and units, can't lose)
resources
- 1 add 10 paint
- 2 add 10 wood
- 3 add 10 metal scrap -not implemented yet-
- 4 add 10 titanium -not implemented yet-
- 5 add 10 food -not implemented yet-
- 6 add 10 max housing
- 7 add 1 level of research (units will have the upgrades already)
units (on mouse position)
- KP 1 add painter
- KP 2 add warrior
- KP 3 add ranged -not implemented yet-
- KP 4 add tank -not implemented yet-
- KP 5 add explorer -not implemented yet-
- KP 0 kill selected unit
buildings (on mouse position)
- Crtl + KP 1 add paint extractor
- Crtl + KP 2 add wood producer
- Crtl + KP 3 add barracks
- Crtl + KP 4 add house
+ F10 God Mode (add resources, buildings and units, can't lose, collisions)
resources
- 1 add 10 paint
- 2 add 10 wood
- 3 add 10 metal scrap -not implemented yet-
- 4 add 10 titanium -not implemented yet-
- 5 add 10 food -not implemented yet-
- 6 add 10 max housing
- 7 add 1 level of research (units will have the upgrades already)
units (on mouse position)
- KP 1 add painter
- KP 2 add warrior
- KP 3 add ranged -not implemented yet-
- KP 4 add tank -not implemented yet-
- KP 5 add explorer -not implemented yet-
- KP 0 kill selected units
buildings (on mouse position)
- Crtl + KP 1 add paint extractor
- Crtl + KP 2 add wood producer
- Crtl + KP 3 add barracks
- Crtl + KP 4 add house
- Crtl + KP 0 kill selected buildings
+ H Go to Town Hall
+ P Pause
+ S/L Save/Load (only save implemented)
+ ESC exit game (not in game scene)
+ N/M/R Zoom In/Out/Reset
+ KP MINUS/KP PLUS Control Framerate (+/- 10)
+ UP/DOWN/LEFT/RIGHT Camera movement

## Developers

Expand Down Expand Up @@ -192,8 +222,8 @@ SOFTWARE.

All the data used (sprites, music, fx, etc), which are free to use, will be credited as well.

There are several Parts in the code (Basic Code Structureand Fonts with Text Bliting) that have been forked from DOLIME CORPORATION.
ALL code inside the disclaimer parts indicated in the code ( Text Bltiting & UI Structure (Highly modified) and core game structure belong to: [Dolime Corporation](https://github.com/Sanmopre/DOLIME-CORP-PROJECT-II)
There are several Parts in the code (Basic Code Structure, Render System with blit queue and Fonts with Text Bliting) that have been forked from DOLIME CORPORATION.
ALL code inside the disclaimer parts indicated in the code (Render System, Text Bltiting & UI Structure (Highly modified) and core game structure belong to: [Dolime Corporation](https://github.com/Sanmopre/DOLIME-CORP-PROJECT-II)
They are also developing and RTS and we encourage you to check it out!

### Disclaimer
Expand Down

0 comments on commit 59b9e88

Please sign in to comment.