//Defialt Constructor //Sets image to new public Ghost(ResourceLibrary library) : base(library) { explodeSprite = (Sprite)library.getResource("GhostLight/GhostLight/resources/explode/explode1.png"); angrySprite = (Sprite)library.getResource("GhostLight/GhostLight/resources/angry-ghost1.png"); complacentSprite = (Sprite)library.getResource("GhostLight/GhostLight/resources/ghost1.png"); type = InteractableObject.ObjectType.GHOST; MakeNotAngry(); unrevealType(); health.setMaxSegments(InteractableObject.getDefualthealth(type)); health.setFilledSegments(health.getMaxSegments()); score = InteractableObject.getDefualtScore(type); base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type)); health.setHeight(0.35f); explodeTimer.setHeight(0.7f); explodeTimer.visible = false; explodeTimer.setCenterX(base.getCenterX()); explodeTimer.setCenterY(health.getCenterY() - (base.getHeight() / 2) + 0.35f); explodeTimer.setWidth(base.getWidth()); explodeTimer.setColor(Color.Yellow); explodeTimer.setMaxSegments(angrySprite.getTotalFrames() + complacentSprite.getTotalFrames()); explodeTimer.setFilledSegments(explodeTimer.getMaxSegments()); }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/flashlightBot.png") == null) { player = new Sprite("GhostLight/GhostLight/resources/flashlightBot.png"); player.loadResource(); library.addResource(player); } else { player = (Sprite)library.getResource("GhostLight/GhostLight/resources/flashlightBot.png"); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/cat.png") == null) { cat = new Sprite("GhostLight/GhostLight/resources/cat.png"); cat.loadResource(); library.addResource(cat); } else { cat = (Sprite)library.getResource("GhostLight/GhostLight/resources/cat.png"); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/dracula.png") == null) { Sprite vampire = new Sprite("GhostLight/GhostLight/resources/dracula.png"); vampire.loadResource(); library.addResource(vampire); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/zombie.png") == null) { Sprite zombie = new Sprite("GhostLight/GhostLight/resources/zombie.png"); zombie.loadResource(); library.addResource(zombie); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/pumpkin.png") == null) { Sprite pumpkin = new Sprite("GhostLight/GhostLight/resources/pumpkin.png"); pumpkin.loadResource(); library.addResource(pumpkin); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/mummy.png") == null) { Sprite mum = new Sprite("GhostLight/GhostLight/resources/mummy.png"); mum.loadResource(); library.addResource(mum); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/frankenstein.png") == null) { Sprite frank = new Sprite("GhostLight/GhostLight/resources/frankenstein.png"); frank.loadResource(); library.addResource(frank); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/spider.png") == null) { Sprite spiderMan = new Sprite("GhostLight/GhostLight/resources/spider.png"); spiderMan.loadResource(); library.addResource(spiderMan); } }
public Zombie(ResourceLibrary library) : base(library) { zombie = (Sprite)library.getResource("GhostLight/GhostLight/resources/zombie.png"); type = InteractableObject.ObjectType.ZOMBIE; unrevealType(); health.setMaxSegments(InteractableObject.getDefualthealth(type)); health.setFilledSegments(health.getMaxSegments()); score = InteractableObject.getDefualtScore(type); base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type)); }
public Frankenstein(ResourceLibrary library) : base(library) { frankenstien = (Sprite)library.getResource("GhostLight/GhostLight/resources/frankenstein.png"); type = InteractableObject.ObjectType.FRANKENSTEIN; isTypeRevealed = false; unrevealType(); health.setMaxSegments(InteractableObject.getDefualthealth(type)); health.setFilledSegments(health.getMaxSegments()); score = InteractableObject.getDefualtScore(type); base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type)); }
public Pumpkin(ResourceLibrary library) : base(library) { pumpkin = (Sprite)library.getResource("GhostLight/GhostLight/resources/pumpkin.png"); type = InteractableObject.ObjectType.PUMPKIN; base.isHelpfull = true; unrevealType(); health.setMaxSegments(InteractableObject.getDefualthealth(type)); health.setFilledSegments(health.getMaxSegments()); score = InteractableObject.getDefualtScore(type); base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type)); }
protected DrawRectangle web = null; //The Web the spider will hang from while Droping public Spider(ResourceLibrary library) : base(library) { spider = (Sprite)library.getResource("GhostLight/GhostLight/resources/spider.png"); type = InteractableObject.ObjectType.SPIDER; unrevealType(); health.setMaxSegments(InteractableObject.getDefualthealth(type)); health.setFilledSegments(health.getMaxSegments()); score = InteractableObject.getDefualtScore(type); base.setInvulnerablility(InteractableObject.getDefualtInvulnerability(type)); }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png") == null) { sparcle = new Sprite(new string[] { "GhostLight/GhostLight/resources/sparcle/sparcle1.png", "GhostLight/GhostLight/resources/sparcle/sparcle2.png", "GhostLight/GhostLight/resources/sparcle/sparcle3.png", "GhostLight/GhostLight/resources/sparcle/sparcle4.png", "GhostLight/GhostLight/resources/sparcle/sparcle5.png" }); sparcle.loadResource(); library.addResource(sparcle); } else { sparcle = (Sprite)library.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png"); } if (library.getResource("GhostLight/GhostLight/resources/life.png") == null) { heart = new Sprite("GhostLight/GhostLight/resources/life.png"); heart.loadResource(); library.addResource(heart); } else { heart = (Sprite)library.getResource("GhostLight/GhostLight/resources/life.png"); } }
public BaseEnemy(ResourceLibrary library) : base() { hostSet = null; hostNode = null; base.setCenterY(-5); base.setSize(5f, 5f); base.rectangleVisible = false; base.spriteVisible = true; base.visible = true; unrevealedSprite = (Sprite)BaseCode.activeLibrary.getResource("GhostLight/GhostLight/resources/unrevealed.png"); selected = new DrawRectangle(); selected.visible = false; selected.setSprite((Sprite)BaseCode.activeLibrary.getResource("GhostLight/GhostLight/resources/glow.png")); selected.rectangleVisible = false; updateSelected(); highLight = new DrawRectangle(); highLight.visible = true; highLight.setSprite((Sprite)BaseCode.activeLibrary.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png")); highLight.rectangleVisible = false; updateHighLight(); highLight.visible = false; displayedScore = new Text(); displayedScore.targetFont = (LoadableFont)BaseCode.activeLibrary.getResource(LoadableFont.createFontID("Comic Sans MS", 1.5f, FontStyle.Italic)); displayedScore.textColor = Color.White; displayedScore.visible = false; updateDisplayedScore(); health.setMaxSegments(2); health.setMaxSegments(health.getMaxSegments()); health.visible = false; health.setWidth(base.getWidth()); health.setHeight(1.4f); health.setColor(Color.LightGreen); infectBar.setColor(Color.FromArgb(10, 80, 40)); infectBar.visible = false; infectCloud = new DrawRectangle(); infectCloud.setSprite((Sprite)library.getResource("GhostLight/GhostLight/resources/infected.png")); infectCloud.rectangleVisible = false; infectCloud.visible = false; base.setPriority(2); updateImage(); }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/angry-ghost1.png") == null) { Sprite angry = new Sprite(new string[] { "GhostLight/GhostLight/resources/angry-ghost1.png", "GhostLight/GhostLight/resources/angry-ghost2.png", "GhostLight/GhostLight/resources/angry-ghost3.png", "GhostLight/GhostLight/resources/angry-ghost4.png", "GhostLight/GhostLight/resources/angry-ghost5.png" }); angry.loadResource(); library.addResource(angry); } if (library.getResource("GhostLight/GhostLight/resources/ghost1.png") == null) { Sprite complacent = new Sprite(new string[] { "GhostLight/GhostLight/resources/ghost1.png", "GhostLight/GhostLight/resources/ghost2.png", "GhostLight/GhostLight/resources/ghost3.png" }); complacent.loadResource(); library.addResource(complacent); } if (library.getResource("GhostLight/GhostLight/resources/explode/explode1.png") == null) { Sprite explode = new Sprite(new string[] { "GhostLight/GhostLight/resources/explode/explode1.png", "GhostLight/GhostLight/resources/explode/explode2.png", "GhostLight/GhostLight/resources/explode/explode3.png", "GhostLight/GhostLight/resources/explode/explode4.png", "GhostLight/GhostLight/resources/explode/explode5.png", "GhostLight/GhostLight/resources/explode/explode6.png", "GhostLight/GhostLight/resources/explode/explode7.png", "GhostLight/GhostLight/resources/explode/explode8.png", "GhostLight/GhostLight/resources/explode/explode9.png", "GhostLight/GhostLight/resources/explode/explode10.png", "GhostLight/GhostLight/resources/explode/explode11.png" }); explode.loadResource(); library.addResource(explode); } }
public static void preLoadResources(ResourceLibrary library) { if (library.getResource("GhostLight/GhostLight/resources/unrevealed.png") == null) { Sprite unrevealedIcons = new Sprite(new string[] { "GhostLight/GhostLight/resources/unrevealed.png", "GhostLight/GhostLight/resources/unrevealed-friendly.png", "GhostLight/GhostLight/resources/unrevealed-unfriendly.png" }); unrevealedIcons.loadResource(); library.addResource(unrevealedIcons); } ; if (library.getResource("GhostLight/GhostLight/resources/glow.png") == null) { Sprite glow = new Sprite("GhostLight/GhostLight/resources/glow.png"); glow.loadResource(); library.addResource(glow); } if (library.getResource("GhostLight/GhostLight/resources/infected.png") == null) { Sprite infect = new Sprite("GhostLight/GhostLight/resources/infected.png"); infect.loadResource(); library.addResource(infect); } if (library.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png") == null) { Sprite sparcle = new Sprite(new string[] { "GhostLight/GhostLight/resources/sparcle/sparcle1.png", "GhostLight/GhostLight/resources/sparcle/sparcle2.png", "GhostLight/GhostLight/resources/sparcle/sparcle3.png", "GhostLight/GhostLight/resources/sparcle/sparcle4.png", "GhostLight/GhostLight/resources/sparcle/sparcle5.png" }); sparcle.loadResource(); library.addResource(sparcle); } if (library.getResource(LoadableFont.createFontID("Comic Sans MS", 1.5f, FontStyle.Italic)) == null) { LoadableFont scoreFont = new LoadableFont("Comic Sans MS", 1.5f, FontStyle.Italic); scoreFont.loadResource(); library.addResource(scoreFont); } }
public static void preLoadResources(ResourceLibrary library) { //Lazer if (library.getResource("GhostLight/GhostLight/resources/lazer.png") == null) { lazer = new Sprite(new string[] { "GhostLight/GhostLight/resources/lazer.png", "GhostLight/GhostLight/resources/lazerGuide.png" }); lazer.loadResource(); library.addResource(lazer); } else { lazer = (Sprite)library.getResource("GhostLight/GhostLight/resources/lazer.png"); } //Light if (library.getResource("GhostLight/GhostLight/resources/light.png") == null) { light = new Sprite(new string[] { "GhostLight/GhostLight/resources/light.png", "GhostLight/GhostLight/resources/lightGuide.png" }); light.loadResource(); library.addResource(light); } else { light = (Sprite)library.getResource("GhostLight/GhostLight/resources/light.png"); } //Sound if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_laser_beam_fire.wav") == null) { LazerSound = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_laser_beam_fire.wav"); LazerSound.loadResource(); library.addResource(LazerSound); } else { LazerSound = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_laser_beam_fire.wav"); } LazerSound.setVolume(0.5); }
public static void preLoadResources(ResourceLibrary library) { //Sparle if (library.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png") == null) { sparcle = new Sprite(new string[] { "GhostLight/GhostLight/resources/sparcle/sparcle1.png", "GhostLight/GhostLight/resources/sparcle/sparcle2.png", "GhostLight/GhostLight/resources/sparcle/sparcle3.png", "GhostLight/GhostLight/resources/sparcle/sparcle4.png", "GhostLight/GhostLight/resources/sparcle/sparcle5.png" }); sparcle.loadResource(); library.addResource(sparcle); } else { sparcle = (Sprite)library.getResource("GhostLight/GhostLight/resources/sparcle/sparcle1.png"); } //Circle Blank if (library.getResource("GhostLight/GhostLight/resources/lightButtons/circleBlank.png") == null) { circleBlank = new Sprite("GhostLight/GhostLight/resources/lightButtons/circleBlank.png"); circleBlank.loadResource(); library.addResource(circleBlank); } else { circleBlank = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/circleBlank.png"); } //Reveal if (library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealIdle.png") == null) { revealIdle = new Sprite("GhostLight/GhostLight/resources/lightButtons/RevealIdle.png"); revealIdle.loadResource(); library.addResource(revealIdle); } else { revealIdle = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealIdle.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealSelected.png") == null) { revealSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/RevealSelected.png"); revealSelected.loadResource(); library.addResource(revealSelected); } else { revealSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealSelected.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealMouseOver.png") == null) { revealMouseOver = new Sprite("GhostLight/GhostLight/resources/lightButtons/RevealMouseOver.png"); revealMouseOver.loadResource(); library.addResource(revealMouseOver); } else { revealMouseOver = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealMouseOver.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealMouseOverSelected.png") == null) { revealMouseOverSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/RevealMouseOverSelected.png"); revealMouseOverSelected.loadResource(); library.addResource(revealMouseOverSelected); } else { revealMouseOverSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/RevealMouseOverSelected.png"); } //Wide if (library.getResource("GhostLight/GhostLight/resources/lightButtons/WideIdle.png") == null) { wideIdle = new Sprite("GhostLight/GhostLight/resources/lightButtons/WideIdle.png"); wideIdle.loadResource(); library.addResource(wideIdle); } else { wideIdle = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/WideIdle.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/WideSelected.png") == null) { wideSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/WideSelected.png"); wideSelected.loadResource(); library.addResource(wideSelected); } else { wideSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/WideSelected.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/WideMouseOver.png") == null) { wideMouseOver = new Sprite("GhostLight/GhostLight/resources/lightButtons/WideMouseOver.png"); wideMouseOver.loadResource(); library.addResource(wideMouseOver); } else { wideMouseOver = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/WideMouseOver.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/WideMouseOverSelected.png") == null) { wideMouseOverSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/WideMouseOverSelected.png"); wideMouseOverSelected.loadResource(); library.addResource(wideMouseOverSelected); } else { wideMouseOverSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/WideMouseOverSelected.png"); } //Lazer if (library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserIdle.png") == null) { lazerIdle = new Sprite("GhostLight/GhostLight/resources/lightButtons/LaserIdle.png"); lazerIdle.loadResource(); library.addResource(lazerIdle); } else { lazerIdle = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserIdle.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserSelected.png") == null) { lazerSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/LaserSelected.png"); lazerSelected.loadResource(); library.addResource(lazerSelected); } else { lazerSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserSelected.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserMouseOver.png") == null) { lazerMouseOver = new Sprite("GhostLight/GhostLight/resources/lightButtons/LaserMouseOver.png"); lazerMouseOver.loadResource(); library.addResource(lazerMouseOver); } else { lazerMouseOver = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserMouseOver.png"); } if (library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserMouseOverSelected.png") == null) { lazerMouseOverSelected = new Sprite("GhostLight/GhostLight/resources/lightButtons/LaserMouseOverSelected.png"); lazerMouseOverSelected.loadResource(); library.addResource(lazerMouseOverSelected); } else { lazerMouseOverSelected = (Sprite)library.getResource("GhostLight/GhostLight/resources/lightButtons/LaserMouseOverSelected.png"); } }
public static void preLoadResources(ResourceLibrary library) { //GhostExplode if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_remove_tile.wav") == null) { ghostExplode = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_remove_tile.wav"); ghostExplode.loadResource(); library.addResource(ghostExplode); } else { ghostExplode = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_remove_tile.wav"); } //DraculaIntro if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_dracular_introduction.wav") == null) { draculaIntro = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_dracular_introduction.wav"); draculaIntro.loadResource(); library.addResource(draculaIntro); } else { draculaIntro = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_dracular_introduction.wav"); } //DraculaAttack if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_dracula_attack.wav") == null) { draculaAttack = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_dracula_attack.wav"); draculaAttack.loadResource(); library.addResource(draculaAttack); } else { draculaAttack = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_dracula_attack.wav"); } //FrankenstienIntro if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_frankenstein.wav") == null) { frankenstienIntro = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_frankenstein.wav"); frankenstienIntro.loadResource(); library.addResource(frankenstienIntro); } else { frankenstienIntro = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_frankenstein.wav"); } //MummyIntro if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_mummy.wav") == null) { mummyIntro = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_mummy.wav"); mummyIntro.loadResource(); library.addResource(mummyIntro); } else { mummyIntro = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_mummy.wav"); } //ZombieIntro if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_zombie.wav") == null) { zombieIntro = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_zombie.wav"); zombieIntro.loadResource(); library.addResource(zombieIntro); } else { zombieIntro = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_zombie.wav"); } //CatAttack if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_cat_attack.wav") == null) { catAttack = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_cat_attack.wav"); catAttack.loadResource(); library.addResource(catAttack); } else { catAttack = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_cat_attack.wav"); } //GhostIntro if (library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_ghost.wav") == null) { ghostIntro = new Sound("GhostLight/GhostLight/resources/Sounds/ghostlight_ghost.wav"); ghostIntro.loadResource(); library.addResource(ghostIntro); } else { ghostIntro = (Sound)library.getResource("GhostLight/GhostLight/resources/Sounds/ghostlight_ghost.wav"); } soundsInOrder = new Sound[] { ghostExplode, draculaIntro, draculaAttack, frankenstienIntro, mummyIntro, zombieIntro, catAttack, ghostIntro }; enumsInOrder = new SoundType[] { SoundType.GHOST_EXPLODE, SoundType.DRACULA_INTRO, SoundType.DRACKULA_ATTACK, SoundType.FRANKENSTIEN_INTRO, SoundType.MUMMY_INTRO, SoundType.ZOMBIE_INTRO, SoundType.CAT_ATTACK, SoundType.GHOST_INTRO }; soundRequests = new bool[soundsInOrder.Length]; for (int loop = 0; loop < soundRequests.Length; loop++) { soundRequests[loop] = false; } }