Re-center slimes
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
21760fbbbc
commit
7caef11d94
@ -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()));
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
BIN
Crawler/assets/circle.png
Normal file
BIN
Crawler/assets/circle.png
Normal file
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 |
Loading…
x
Reference in New Issue
Block a user