[html5] sicko proj
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
- import Phaser from 'phaser';
- class Game extends Phaser.Scene {
- constructor() {
- super({ key: 'GameScene' });
- }
- init(data) {}
- //loading Assets
- preload() {
- new Phaser.Game(1440,1080, Phaser.auto)
- this.load.image('demomodeanim', 'assets/demomode.png', 'assets');
- this.load.image('background', 'assets/loadingscreen.png');
- this.load.image('title', 'assets/title2.png');
- this.load.image('insertmoney', 'assets/insertmoney.png');
- this.load.image('moneyin', 'assets/moneyin.png')
- this.load.audio("title_music", "assets/music.mp3");
- }
- /// Creating Menu Splash Screen
- create(data) {
- // Create Images
- this.add.image(this.game.renderer.width / 2, this.game.renderer.height * 0.42, "title").setDepth(1);
- this.add.image(this.game.renderer.width / 2, this.game.renderer.height * 0.95, "moneyin").setDepth(1);
- this.add.image(0,0, "background").setDisplayOrigin(0).setDepth(0);
- this.add.image(this.game.renderer.width / 2, this.game.renderer.height * 0.20, "demomodeanim").setDepth(1);
- var sprite = game.add.sprite(game.world.centerX, game.world.centerY, 'demomodeanim');
- this.game.add.tween(sprite).to( { alpha: 1 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
- sprite.anchor.setTo(0.5, 0.5);
- sprite.alpha = 0;
- game.add.tween(sprite).to( { alpha: 1 }, 2000, Phaser.Easing.Linear.None, true, 0, 1000, true);
- //play Button
- let playButton = this.add.image(this.game.renderer.width / 2, this.game.renderer.height / 1.15, "insertmoney").setDepth(1);
- ///Create audio disable pause on blur
- this.sound.pauseOnBlur = false;
- this.sound.play("title_music", {
- loop:true
- });
- //create animation
- this.anims.create({
- key: 'demomodeanim',
- frameRate: 1,
- frames: this.anims.generateFrameNumbers('demomodeanim', { start: 1, end: 2,}),
- repeat: -1,
- });
- function createscene(){
- //Animation Definitions here
- }
- //Title Animation Experiment
- //make image buttons interacrive
- /*
- PointerEvents:
- pointerover - hovering
- pointerput - not hovering
- pointerup - click and release
- pointerdown - just click
- */
- playButton.setInteractive();
- }
- update(time, delta) {}
- }
- export default Game;
Editor
You can edit this paste and save as new: