Skip to content

Commit

Permalink
Merge pull request #968 from Flet/spawnkill
Browse files Browse the repository at this point in the history
Updating PlayerSpawn tiles (flag tiles) to only allow player to pass.
  • Loading branch information
Flet committed May 17, 2012
2 parents 129913c + c6032b6 commit 139512b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/com/mojang/mojam/level/tile/PlayerSpawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

import com.mojang.mojam.GameCharacter;
import com.mojang.mojam.MojamComponent;
import com.mojang.mojam.entity.Bullet;
import com.mojang.mojam.entity.Entity;
import com.mojang.mojam.entity.Player;
import com.mojang.mojam.entity.loot.Loot;
import com.mojang.mojam.entity.mob.Team;
import com.mojang.mojam.level.Level;
import com.mojang.mojam.screen.AbstractBitmap;
Expand Down Expand Up @@ -54,8 +56,13 @@ private GameCharacter getPlayerCharacter(int playerID){
else return player.getCharacter();
}

public boolean canPass(Entity e) {
return true;
@Override
public boolean canPass(Entity e) { //only allow players/loot/bullets to pass the spawn flag
if ((e instanceof Player) || (e instanceof Loot) || (e instanceof Bullet)) {
return true;
}

return false;
}

public int getColor() {
Expand Down

0 comments on commit 139512b

Please sign in to comment.