Created
August 18, 2023 14:49
-
-
Save modemlooper/feb75726250ebe34bde9cd4e6986a621 to your computer and use it in GitHub Desktop.
phaser test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Gamefroot Arcade</title> | |
<style> | |
body, html { | |
margin: 0; | |
padding: 0; | |
background: black; | |
overflow: hidden; | |
} | |
#game-container { | |
margin: auto; | |
} | |
</style> | |
<script src="libs/phaser.js"></script> | |
<script> | |
class Example extends Phaser.Scene { | |
preload () { | |
this.load.audio('convo', [ | |
'https://smp.dev.apppresser.com/wp-content/uploads/2023/08/day-1-1.mp3' | |
]); | |
this.load.audio('background', [ | |
'assets/audio/1692317314673-1679002482779-Dare-38-Track-1.mp3' | |
]); | |
} | |
create () { | |
const music = this.sound.add('background', {volume: 0.5, loop: true }); | |
music.play(); | |
// const convo = this.sound.add('convo'); | |
// convo.play(); | |
} | |
} | |
const config = { | |
type: Phaser.AUTO, | |
parent: 'phaser-example', | |
width: 800, | |
height: 600, | |
scene: Example, | |
audio: { | |
disableWebAudio: false | |
} | |
}; | |
new Phaser.Game(config); | |
</script> | |
</head> | |
<body> | |
<div id="phaser-example"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment