Made map data xml tag more specific (output width and height as values). Add load level functionality, changes world size.

This commit is contained in:
2023-06-22 02:46:38 -07:00
parent 2ec484206d
commit d6e9ade54e
6 changed files with 39 additions and 15 deletions
+2 -2
View File
@@ -221,11 +221,11 @@ void Player::Update(float fElapsedTime){
vel.y=std::min(0.f,vel.y+friction*fElapsedTime);
}
float newX=pos.x+vel.x*fElapsedTime;
if(newX-12*size>0&&newX+12*size<game->WORLD_SIZE.x*24){
if(newX-12*size>0&&newX+12*size<game->GetWorldSize().x*24){
pos.x=newX;
}
float newY=pos.y+vel.y*fElapsedTime;
if(newY-12*size>0&&newY+12*size<game->WORLD_SIZE.y*24){
if(newY-12*size>0&&newY+12*size<game->GetWorldSize().y*24){
pos.y=newY;
}
if(attack_cooldown_timer==0&&game->GetMouse(0).bHeld){