public Player(enviroment env) { anzeige = new animatedSprite(); int[] temp = { statsGame.PlayerSpawnpoint[0]*statsGame.lineSize[0], statsGame.PlayerSpawnpoint[1]*statsGame.lineSize[1] }; anzeige.setPosition(temp,false); anzeige.setSize(statsGame.lineSize); //Gameplayeinstellungen: maxLife = statsGame.playerStartLife; invincible = false; life = maxLife; invincibleTime = 0; maxInvincibleTime = statsGame.PlayerMaxInvincibleTime; int aktDirection = 0; //Verweise: this.env = env; //Inventar: inventory = new Inventory(8); inventory.setPlayer(this); inventory.setEnviroment(env); }
public NPC(int[] position,enviroment env,int damage,int speed) { anzeige = new animatedSprite(); anzeige.setPosition(position, false); //anzeige.setSize(NPCStats.mobSize); r = new Random(); nextTurn = r.Next(1000); this.env = env; this.damage = damage; this.speed = speed; }
public void move(int direction) { switch (direction) { case staticUtils.north: if (loadedAnimation != "up") { anzeige = statsPlayerTextures.PlayerLoadRunUp(anzeige); loadedAnimation = "up"; } break; case staticUtils.east: if (loadedAnimation != "right") { anzeige = statsPlayerTextures.PlayerLoadRunRight(anzeige); loadedAnimation = "right"; } break; case staticUtils.south: if (loadedAnimation != "down") { anzeige = statsPlayerTextures.PlayerLoadRunDown(anzeige); loadedAnimation = "down"; } break; case staticUtils.west: if (loadedAnimation != "left") { anzeige = statsPlayerTextures.PlayerLoadRunLeft(anzeige); loadedAnimation = "left"; } break; case staticUtils.northWest: if (loadedAnimation != "UpLeft") { anzeige = statsPlayerTextures.PlayerLoadRunUpLeft(anzeige); loadedAnimation = "UpLeft"; } break; case staticUtils.northEast: if (loadedAnimation != "UpRight") { anzeige = statsPlayerTextures.PlayerLoadRunUpRight(anzeige); loadedAnimation = "UpRight"; } break; case staticUtils.southWest: if (loadedAnimation != "DownLeft") { anzeige = statsPlayerTextures.PlayerLoadRunDownLeft(anzeige); loadedAnimation = "DownLeft"; } break; case staticUtils.southEast: if (loadedAnimation != "DownRight") { anzeige = statsPlayerTextures.PlayerLoadRunDownRight(anzeige); loadedAnimation = "DownRight"; } break; } if (invincible) anzeige.color = Color.Red; TimeLastMove = 0; aktDirection = direction; }
public void load() { anzeige = statsPlayerTextures.PlayerLoadRunUp(anzeige); }