Re-center slimes

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
2023-06-12 19:23:43 +00:00
co-authored by AMay
parent 21760fbbbc
commit 7caef11d94
5 changed files with 4 additions and 2 deletions
+2
View File
@@ -28,6 +28,7 @@ bool Crawler::OnUserCreate(){
//Graphics
GFX_Pl_Sheet.Load("assets/nico-warrior.png");
GFX_Slime_Sheet.Load("assets/slime.png");
GFX_Circle.Load("assets/circle.png");
//Animations
InitializeAnimations();
@@ -248,6 +249,7 @@ void Crawler::RenderWorld(float fElapsedTime){
std::copy_if(MONSTER_LIST.begin(),MONSTER_LIST.end(),std::back_inserter(monstersAfter),[&pl](Monster&m){return m.GetPos().y>=pl.GetPos().y;});
std::sort(monstersBefore.begin(),monstersBefore.end(),[](Monster&m1,Monster&m2){return m1.GetPos().y<m2.GetPos().y;});
std::sort(monstersAfter.begin(),monstersAfter.end(),[](Monster&m1,Monster&m2){return m1.GetPos().y<m2.GetPos().y;});
view.DrawDecal(player.GetPos()+vf2d{-12,12-4},GFX_Circle.Decal(),{24/3,1});
for(Monster&m:monstersBefore){
view.DrawPartialDecal(m.GetPos()-vf2d{12,12}*m.GetSizeMult(),m.GetFrame().GetSourceImage()->Decal(),m.GetFrame().GetSourceRect().pos,m.GetFrame().GetSourceRect().size,vf2d(m.GetSizeMult(),m.GetSizeMult()));
}
+1 -1
View File
@@ -14,7 +14,7 @@ class Crawler : public olc::PixelGameEngine
Camera2D camera;
TileTransformedView view;
Player player;
Renderable GFX_Pl_Sheet,GFX_Slime_Sheet;
Renderable GFX_Pl_Sheet,GFX_Slime_Sheet,GFX_Circle;
public:
Crawler();
+1 -1
View File
@@ -8,7 +8,7 @@ private:
int hp=100,maxhp=hp;
int atk=10;
vf2d pos;
float z;
float z=0;
float moveSpd=1.0f;
float size=1.0f;
float attack_range=1.5f;
Binary file not shown.

After

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 13 KiB