Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilya246 authored Mar 26, 2021
1 parent d8dd411 commit ce41242
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/crawler_arena/CrawlerArenaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void init(){
Events.on(PlayerJoin.class, e -> {
if(!units.containsKey(e.player.uuid()) || !money.containsKey(e.player.uuid())){
money.put(e.player.uuid(), new float[]{Mathf.pow(2.71f, 1f + wave / 2 + Mathf.pow(wave, 2) / 4000f) * 7f});
Unit spawnUnit = UnitTypes.dagger.spawn(worldCenterX * 8, worldCenterY * 8);
Unit spawnUnit = UnitTypes.dagger.spawn(worldCenterX, worldCenterY);
spawnUnit.add();
units.put(e.player.uuid(), spawnUnit);
e.player.unit(spawnUnit);
Expand All @@ -106,7 +106,12 @@ public void init(){
};
});
Events.on(PlayerLeave.class, e -> {
Unit u = units.get(e.player.uuid());
Unit u;
try{
u = units.get(e.player.uuid());
}catch(Exception help){
u = UnitTypes.dagger.spawn(worldCenterX, worldCenterY);
};
float hp = u.health;
boolean isAlive = hp > 0;
u.kill();
Expand Down

0 comments on commit ce41242

Please sign in to comment.