Visual Effects


start:
  - show store:
  - show marco: 
  - marco says: It looks like there's going to be a storm.
  - effect FLASHIMAGE:
    screenShake: true
    sfx: thunderSFX
    image: thunder
  - marco says happy: Here it is!
  - ambient RAIN:
  - text: It will get worse in 3...
  - text: 2...
  - text: 1...
  - text: Now
  - ambient CLEAR:
  - ambient HEAVYRAIN:
  - marco says: The storm is getting worse, I should go back.
  - text: Rain will stop in 3...
  - text: 2...
  - text: 1...
  - text: Now
  - ambient CLEAR:
  - marco says: That's much better
  - ambient SNOW:
  - marco says worry: Oh no
  - show jair: angry AT RIGHT
  - jair says: Not so fast! Let's battle!
  - marco says: You leave me no choice.
  - marco says angry: Take this!
  - effect ATTACK:
  - hide jair:
  - ambient CLEAR:
  - marco says: It's time to go home.
  - hide ALL:
  - show street_morning:
  - show liz: 
  - ambient SAKURA:
  - liz says happy: What a beautiful morning.
  - liz says: There are cherry blossoms everywhere!
  - ambient CLEAR:
  - hide ALL:
  - effect ROLLINGCREDITS:
    endGame: true
    text:
      - asdf
      - qwer
      - null
      - asdf
      - qwer
      - null
      - null
      - asdf
      - qwer
      - null
      - characters by
      - Shida
      - null
      - music by
      - Evan Schaeffer
									


backgrounds:
  store: assets/backgrounds/store.jpg
  street_morning: assets/backgrounds/school_front_morning.jpg

characters:
  marco:
    displayName: Marco
    speechColour: "#123022"
    looks:
      normal: assets/characters/Char1NormalSchool.png
      happy: assets/characters/Char1HappySchool.png
      angry: assets/characters/Char1AngrySchool.png
      worry: assets/characters/Char1WorrySchool.png
  jair:
    displayName: Jair
    speechColour: "#6a2b2b"
    looks:
      normal: assets/characters/Char4NormalSchool.png
      happy: assets/characters/Char4HappySchool.png
      angry: assets/characters/Char4AngrySchool.png
  liz:
    displayName: Liz
    speechColour: "#d5e6e7"
    looks:
      normal: assets/characters/Char2NormalSchool.png
      happy: assets/characters/Char2HappySchool.png
      angry: assets/characters/Char2AngrySchool.png

music:
  rainBGS: assets/audio/Rain.mp3
sfx:
  thunderSFX: assets/audio/thunder_strike_1.mp3
  lashSFX: assets/audio/51755__erkanozan__whip-01.wav
extra:
  image:
    title: assets/gui/titles.png
    rain: assets/ambient/rain.png
    thunder: assets/effects/Thunder_Effect.png
    attack: assets/effects/Attack_1.png
    chainattack1: assets/effects/Attack_2.png
    chainattack2: assets/effects/Attack_3.png
    chainattack3: assets/effects/Attack_4.png
    multiattack: assets/effects/Attack_5.png
  spritesheets:
    snowflakes: assets/ambient/snowflakes.png 17 17
    snowflakes_large: assets/ambient/snowflakes_large.png 64 64
    sakura: assets/ambient/sakura-petals.png 17 26

								


class AttackEffect extends RenJS.Plugin {

	onCall(params) {
        let flashEffect = this.game.screenEffects.effects.FLASHIMAGE.bind(this.game.screenEffects.effects);
        flashEffect({
            image:"chainattack1",
            sfx:"lashSFX",
            shakeScreen:true
        }).then(()=>{
            flashEffect({
                image:"chainattack2",
                sfx:"lashSFX",
                shakeScreen:true
            }).then(()=>{
                flashEffect({
                    image:"chainattack3",
                    sfx:"lashSFX",
                    shakeScreen:true
                }).then(()=>{
                    // resolve to continue the story
                    this.game.resolveAction();
                });
            });
        });
	}
}

RenJSGame.addPlugin('ATTACK',AttackEffect)
								


class HEAVYRAIN extends RenJS.Plugin {

    // Ambients don't need to call resolveAction

    onCall(params) {
        this.game.managers.audio.play('rainBGS','bgs',true,'FADE');
        let maxLifespan = 1600;
        let ambientManager = this.game.screenEffects.ambient;
        let e1 = ambientManager.addEmitter({
            maxParticles: 400,
            sprite:'rain',
            frames: [0],
            scale: [0.1,0.5],
            speed: {y:[300,500],x:[-5,5]},
            rotation: [0,0]
        },[false, maxLifespan, 5, 0]);
        let e2 = ambientManager.addEmitter({
            maxParticles: 400,
            sprite:'rain',
            frames: [0],
            scale: [0.5,1],
            speed: {y:[500,700],x:[-5,5]},
            rotation: [0,0]
        },[false, maxLifespan, 5, 0]);

        ambientManager.clearFunctions.push(()=>{
            ambientManager.destroyEmitters([e1,e2],maxLifespan);
            this.game.managers.audio.stop('bgs','FADE');
        })
    }
}
RenJSGame.addPlugin('HEAVYRAIN',HEAVYRAIN)
								

Return to the Gallery Download from Github