diff --git a/.gitignore b/.gitignore index 0f018bf..ebc0c42 100644 --- a/.gitignore +++ b/.gitignore @@ -32,18 +32,26 @@ reated by https://www.gitignore.io/api/vim,c++,linux *.out *.app -### CodeBlocks ### -# specific to CodeBlocks IDE -*.cbp -*.layout -*.depend - # generated directories bin/ obj/ -### My files ### -*.project.cpp -source/collisions.cpp -source/collisions.h -*.psd +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ diff --git a/src/.maps.cpp.swp b/src/.maps.cpp.swp deleted file mode 100644 index 4e4d604..0000000 Binary files a/src/.maps.cpp.swp and /dev/null differ diff --git a/src/entity/player.cpp b/src/entity/player.cpp index 112f57f..6672a22 100644 --- a/src/entity/player.cpp +++ b/src/entity/player.cpp @@ -155,11 +155,14 @@ void Player::move(){ if(run!=1) ifRunning = true; + //Get the position and update the velY with gravity velocityY -= gravity * dt; float x = velocityX * dt * run; float y = velocityY * dt; + std::cout << velocityY << " " << posY << " " << y << std::endl; + //Convert and set new int position posX += static_cast(x); posY -= static_cast(y+0.5); diff --git a/src/entity/player.h b/src/entity/player.h index 75b026e..0693fbd 100644 --- a/src/entity/player.h +++ b/src/entity/player.h @@ -1,4 +1,4 @@ -//Player class header< +//Player class header #ifndef __PLAYER_H_INCLUDED__ #define __PLAYER_H_INCLUDED__