Merge pull request #85 from VEGO-Engine/remove-assets
Removed assets and startscreen from engine
@ -1,106 +0,0 @@
|
|||||||
{ "frames": [
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 32, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 64, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 96, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 128, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 160, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 192, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 224, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 256, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"filename": "MapNew.aseprite",
|
|
||||||
"frame": { "x": 288, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"rotated": false,
|
|
||||||
"trimmed": false,
|
|
||||||
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
|
|
||||||
"sourceSize": { "w": 32, "h": 32 },
|
|
||||||
"duration": 100
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"meta": {
|
|
||||||
"app": "https://www.aseprite.org/",
|
|
||||||
"version": "1.3.2-x64",
|
|
||||||
"format": "RGBA8888",
|
|
||||||
"size": { "w": 320, "h": 32 },
|
|
||||||
"scale": "1",
|
|
||||||
"frameTags": [
|
|
||||||
],
|
|
||||||
"layers": [
|
|
||||||
],
|
|
||||||
"slices": [
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB |
@ -1,20 +0,0 @@
|
|||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,2,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,2,2,2,3
|
|
||||||
3,3,3,2,3,3,3,3,2,3,7,1,1,1,9,3,3,3,3,3,3,3,2,2,3
|
|
||||||
3,3,2,2,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,2,2,2,3,3,3,3,3,7,1,1,1,9,3,3,2,3,3,3,3,3,3,3
|
|
||||||
3,3,2,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,2,3,3,3,3
|
|
||||||
3,3,3,2,2,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,2,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,2,2,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,2,3,3,7,1,1,1,9,3,2,3,3,2,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,2,3,3,3,3,3,3,3,3
|
|
||||||
2,2,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,2,2,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
3,3,3,3,3,3,3,3,3,3,7,1,1,1,9,3,3,3,3,3,3,3,3,3,3
|
|
||||||
|
Before Width: | Height: | Size: 571 B |
BIN
assets/cat.png
|
Before Width: | Height: | Size: 407 B |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 751 B |
|
Before Width: | Height: | Size: 913 B |
|
Before Width: | Height: | Size: 836 B |
|
Before Width: | Height: | Size: 847 B |
|
Before Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
BIN
assets/cow.png
|
Before Width: | Height: | Size: 5.3 KiB |
BIN
assets/dirt.png
|
Before Width: | Height: | Size: 877 B |
BIN
assets/egg.png
|
Before Width: | Height: | Size: 271 B |
BIN
assets/grass.png
|
Before Width: | Height: | Size: 943 B |
|
Before Width: | Height: | Size: 1011 B |
|
Before Width: | Height: | Size: 1.1 KiB |
BIN
assets/heart.png
|
Before Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 550 B |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 643 B |
|
Before Width: | Height: | Size: 35 KiB |
BIN
assets/stone.png
|
Before Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 33 KiB |
BIN
assets/water.png
|
Before Width: | Height: | Size: 914 B |
|
Before Width: | Height: | Size: 1.2 KiB |
@ -5,6 +5,7 @@
|
|||||||
#include "CollisionHandler.h"
|
#include "CollisionHandler.h"
|
||||||
#include "AssetManager.h"
|
#include "AssetManager.h"
|
||||||
#include "RenderManager.h"
|
#include "RenderManager.h"
|
||||||
|
#include "SDL_mixer.h"
|
||||||
#include "SoundManager.h"
|
#include "SoundManager.h"
|
||||||
#include "TileComponent.h"
|
#include "TileComponent.h"
|
||||||
#include "Direction.h"
|
#include "Direction.h"
|
||||||
@ -62,11 +63,11 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_Surface* icon = SDL_LoadBMP("assets/iconImage.bmp");
|
// bad
|
||||||
if(!icon)
|
SDL_Surface* icon;
|
||||||
|
if((icon = SDL_LoadBMP("assets/iconImage.bmp")))
|
||||||
{
|
{
|
||||||
std::cout << "ERROR: Couldn't create icon!" << std::endl;
|
SDL_SetWindowIcon(window, icon);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SDL_SetWindowIcon(window, icon);
|
SDL_SetWindowIcon(window, icon);
|
||||||
@ -80,12 +81,6 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
|
|||||||
}
|
}
|
||||||
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
|
||||||
|
|
||||||
SDL_Texture* backgroundTexture = GameInternal::textureManager->loadTexture("assets/startscreen.png");
|
|
||||||
|
|
||||||
SDL_RenderClear(renderer);
|
|
||||||
SDL_RenderCopy(renderer, backgroundTexture, NULL, NULL);
|
|
||||||
SDL_RenderPresent(renderer);
|
|
||||||
|
|
||||||
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0)
|
if (Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 2048) < 0)
|
||||||
{
|
{
|
||||||
std::cout << "ERROR: Mixer couldnt be initialized! " << SDL_GetError() << std::endl;
|
std::cout << "ERROR: Mixer couldnt be initialized! " << SDL_GetError() << std::endl;
|
||||||
@ -96,43 +91,6 @@ void GameInternal::init(const char* title, int xpos, int ypos, int width, int he
|
|||||||
Mix_Volume(-1, MIX_MAX_VOLUME);
|
Mix_Volume(-1, MIX_MAX_VOLUME);
|
||||||
Mix_AllocateChannels(16);
|
Mix_AllocateChannels(16);
|
||||||
|
|
||||||
//SDL_Event event;
|
|
||||||
bool hasQuit = false;
|
|
||||||
|
|
||||||
while (!hasQuit)
|
|
||||||
{
|
|
||||||
SDL_PollEvent(&event);
|
|
||||||
|
|
||||||
if (event.type == SDL_QUIT)
|
|
||||||
{
|
|
||||||
hasQuit = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.type == SDL_KEYDOWN)
|
|
||||||
{
|
|
||||||
if (event.key.keysym.scancode == SDL_SCANCODE_RETURN)
|
|
||||||
{
|
|
||||||
std::cout << "Enter pressed > Game start..." << std::endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.key.keysym.scancode == SDL_SCANCODE_ESCAPE)
|
|
||||||
{
|
|
||||||
std::cout << "Escape pressed > Game quit..." << std::endl;
|
|
||||||
hasQuit = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasQuit)
|
|
||||||
{
|
|
||||||
this->setRunning(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this->isRunning() == false) return;
|
|
||||||
|
|
||||||
map = new Map();
|
map = new Map();
|
||||||
|
|
||||||
// loading sounds
|
// loading sounds
|
||||||
|
|||||||
@ -61,6 +61,6 @@ void Map::addTile(unsigned long id, int x, int y, GameInternal* game, const std:
|
|||||||
auto& tile(game->manager.addEntity());
|
auto& tile(game->manager.addEntity());
|
||||||
tile.addComponent<TileComponent>(x, y, TILE_SIZE, TILE_SIZE, id, textureDict);
|
tile.addComponent<TileComponent>(x, y, TILE_SIZE, TILE_SIZE, id, textureDict);
|
||||||
|
|
||||||
if(tile.getComponent<TileComponent>().hasCollision()) tile.addComponent<ColliderComponent>(tile.getComponent<TileComponent>().getName().data());
|
if(tile.getComponent<TileComponent>().hasCollision()) tile.addComponent<ColliderComponent>("tile"/*tile.getComponent<TileComponent>().getName().data()*/);
|
||||||
tile.addGroup((size_t)Entity::GroupLabel::MAPTILES);
|
tile.addGroup((size_t)Entity::GroupLabel::MAPTILES);
|
||||||
}
|
}
|
||||||