Fixed map, tweaked gravity/jump, added puppy

This commit is contained in:
2021-01-31 14:29:29 -05:00
parent 3481c20e4f
commit 5d76cfe49c
12 changed files with 96 additions and 5 deletions

View File

@ -79,7 +79,7 @@ public:
}
Game::gravityOnPlayer = true;
sprite->Play("Jump");
transform->velocity.y = -1;
transform->velocity.y = -2;
break;
default:
break;

View File

@ -112,7 +112,7 @@ public:
animations.emplace("Walk", walk);
Animation jump = Animation(2,1,100);
animations.emplace("Jump", jump);
Animation fall = Animation(2,2,100);
Animation fall = Animation(3,1,100);
animations.emplace("Fall",fall);
Play("Idle");
}

View File

@ -117,7 +117,7 @@ void Game::init(const char *title, int width, int height, bool fullscreen, int g
//ecs implementation
map->LoadMap("assets/maps/br-map.txt",70,45, globalScale);
map->LoadMap("assets/maps/br-map-color.txt",70,45, globalScale);
player.addComponent<TransformComponent>(150*globalScale,80*globalScale,22,42,globalScale);
// player.addComponent<TransformComponent>(150*globalScale,80*globalScale,40,40,globalScale);
@ -170,7 +170,7 @@ void Game::update()
if (Mix_PlayingMusic() == 0)
{
// std::cout << "Play Music Now" << std::endl;
// Mix_PlayMusic(assets->GetMusicTrack("simonZ"), -1);
Mix_PlayMusic(assets->GetMusicTrack("simonZ"), -1);
}
manager.refresh();
@ -194,7 +194,7 @@ void Game::update()
// Gravity
if (gravityOnPlayer){
player.getComponent<TransformComponent>().position.y += 5;
player.getComponent<TransformComponent>().position.y += 10;
}
// for(auto& p: projectiles)
// {