public void getCollision(SpecialFish specialFish) { if (InputManager.KeyboardKeyPressed(Keys.Space)) { if (position.X > specialFish.getPosition().X - 16 && position.X < specialFish.getPosition().X + 16) { if (position.Y > specialFish.getPosition().Y - 32 && position.Y < specialFish.getPosition().Y) { if (!specialFish.getStatus()) { contUpgrade++; isUpgrading = true; if (contUpgrade == 200) { if (specialFish.getDepth() == 1) { upTemperatureResist(); specialFish.scanning(); } if (specialFish.getDepth() == 2) { upTemperatureResist(); upPressureResist(); specialFish.scanning(); } if (specialFish.getDepth() == 3) { upTemperatureResist(); upPressureResist(); upLight(); specialFish.scanning(); } if (specialFish.getDepth() == 4) { upTemperatureResist(); upPressureResist(); upLight(); specialFish.scanning(); } } } else { contUpgrade = 0; isUpgrading = false; } } else { contUpgrade = 0; isUpgrading = false; } } else { contUpgrade = 0; isUpgrading = false; } } else { contUpgrade = 0; isUpgrading = false; } }
public void initialize() { enemyManager = new EnemyManager(graphics, content, depth, 20, Color.White); enemyManager.initialize(); specialFish = new SpecialFish(graphics, content, depth); specialFish.initialize(); whale = new Whale(graphics, content); whale.initialize(); mapChangedDown = false; mapChangedUp = false; pressure = 1; temperature = 10; lighting = 1; #region typeMap define if (depth == 1) { temperature = 20; pressure = 1; lighting = 1; } if (depth == 2) { temperature = 15; pressure = 1; lighting = 1; } if (depth == 3) { temperature = 10; pressure = 2; lighting = 1; } if (depth == 4) { temperature = 5; pressure = 3; lighting = 2; } #endregion #region colorMap color = Color.White; if (depth == 1) { color = Color.LightCoral; } if (depth == 2) { color = Color.CornflowerBlue; } if (depth == 3) { color = Color.Blue; } if (depth == 4) { color = Color.DarkBlue; } #endregion }