Skip to content

Commit

Permalink
added stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
fauwara committed Sep 4, 2021
1 parent ed8dfb1 commit 7fa81af
Show file tree
Hide file tree
Showing 8 changed files with 341 additions and 341 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# noob-game
come when its completed :)
# noob-game
come when its completed :)
42 changes: 21 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>NOOB GAME</title>
<script type="text/javascript" src="./phaser.min.js"></script>
<link rel="stylesheet" href="./src/css/game.css" />

<script type="text/javascript" src="./src/js/bootGame.js"></script>
<script type="text/javascript" src="./src/js/mainMenu.js"></script>
<script type="text/javascript" src="./src/js/mainGame.js"></script>

<script type="text/javascript" src="./src/js/game.js"></script>
<script type="text/javascript" src="./src/js/console-messages.js"></script>
</head>

<body>
<!-- this is empty -->
</body>

<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8" />
<title>NOOB GAME</title>
<script type="text/javascript" src="./phaser.min.js"></script>
<link rel="stylesheet" href="./src/css/game.css" />

<script type="text/javascript" src="./src/js/bootGame.js"></script>
<script type="text/javascript" src="./src/js/mainMenu.js"></script>
<script type="text/javascript" src="./src/js/mainGame.js"></script>

<script type="text/javascript" src="./src/js/game.js"></script>
<script type="text/javascript" src="./src/js/console-messages.js"></script>
</head>

<body>
<!-- this is empty -->
</body>

</html>
30 changes: 15 additions & 15 deletions src/css/game.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
*{
margin: 0px;
}

body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: rgb(27, 27, 27);
}

canvas {
align-items: center;
margin: auto;
*{
margin: 0px;
}

body{
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: rgb(27, 27, 27);
}

canvas {
align-items: center;
margin: auto;
}
108 changes: 54 additions & 54 deletions src/js/bootGame.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,54 @@
class bootGame extends Phaser.Scene {
constructor() {
super("bootGame");
}

preload() {
//images
this.load.image("bg", "src/assets/bg.png");
this.load.image("player", "src/assets/samurai.png");
//sprites
this.load.spritesheet("ghost", "src/assets/ghost-sprite.png", {
//ghost
frameWidth: 75,
frameHeight: 75,
});
this.load.spritesheet("candy", "src/assets/candy-sprite.png", {
// candy
frameWidth: 22,
frameHeight: 22,
});

// audio
// this.load.audio("roblox-death-audio", "src/assets/roblox-death.mp3"); // "src/assets/roblox-death.ogg",
}

create() {

this.add.text(20, 20, "Loading Game...");
// create animations
this.anims.create({
key: "candy_beam",
frames: this.anims.generateFrameNumbers("candy", {
start: 0,
end: 1,
}),
frameRate: 5,
repeat: -1,
});
// ghost walk animation
this.anims.create({
key: "ghost_walk",
frames: this.anims.generateFrameNumbers("ghost", {
start: 0,
end: 1,
}),
frameRate: 5,
repeat: -1,
});

// this.deathSound = this.sound.add("roblox-death-audio");

this.scene.start("mainMenu");
}
}
class bootGame extends Phaser.Scene {
constructor() {
super("bootGame");
}

preload() {
//images
this.load.image("bg", "src/assets/bg.png");
this.load.image("player", "src/assets/samurai.png");
//sprites
this.load.spritesheet("ghost", "src/assets/ghost-sprite.png", {
//ghost
frameWidth: 75,
frameHeight: 75,
});
this.load.spritesheet("candy", "src/assets/candy-sprite.png", {
// candy
frameWidth: 22,
frameHeight: 22,
});

// audio
// this.load.audio("roblox-death-audio", "src/assets/roblox-death.mp3"); // "src/assets/roblox-death.ogg",
}

create() {

this.add.text(20, 20, "Loading Game...");
// create animations
this.anims.create({
key: "candy_beam",
frames: this.anims.generateFrameNumbers("candy", {
start: 0,
end: 1,
}),
frameRate: 5,
repeat: -1,
});
// ghost walk animation
this.anims.create({
key: "ghost_walk",
frames: this.anims.generateFrameNumbers("ghost", {
start: 0,
end: 1,
}),
frameRate: 5,
repeat: -1,
});

// this.deathSound = this.sound.add("roblox-death-audio");

this.scene.start("mainMenu");
}
}
46 changes: 23 additions & 23 deletions src/js/console-messages.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
console.log(" Hows the music? \n\n .\n |\ \n _j .___,\n (_j |---|\n _| |\n .____. (_j _|\n |.--.| . (_J\n |l__j| .\n |+ oo| .\n l____j\n\n");
// * _____
// * __/_ ///
// * / _/ \
// * \/_\=[o=o]
// * \_, __)
// * | _\
// * l______/
// * / :|
// * / \ ;|-
// * \_______j
// * ./.....\..
// *

// * _ _
// * /\\_//\
// * / o _ o \
// * /_ X _\
// * \_____/
// * / o \
// * / \__
// * \_(_|_)___ \
// * (___/
console.log(" Hows the music? \n\n .\n |\ \n _j .___,\n (_j |---|\n _| |\n .____. (_j _|\n |.--.| . (_J\n |l__j| .\n |+ oo| .\n l____j\n\n");
// * _____
// * __/_ ///
// * / _/ \
// * \/_\=[o=o]
// * \_, __)
// * | _\
// * l______/
// * / :|
// * / \ ;|-
// * \_______j
// * ./.....\..
// *

// * _ _
// * /\\_//\
// * / o _ o \
// * /_ X _\
// * \_____/
// * / o \
// * / \__
// * \_(_|_)___ \
// * (___/
// *
44 changes: 22 additions & 22 deletions src/js/game.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
var config = {
type: Phaser.AUTO,
width: 1200,
height: 675,
scene: [bootGame, mainMenu, mainGame],
pixelArt: true,
physics: {
default: "arcade",
arcade: {
debug: false,
},
},
};

var player; //player
var playerSpeed = 200;
var distance;
var target = new Phaser.Math.Vector2();

var candyTarget = new Phaser.Math.Vector2();

var game = new Phaser.Game(config);
var config = {
type: Phaser.AUTO,
width: 1200,
height: 675,
scene: [bootGame, mainMenu, mainGame],
pixelArt: true,
physics: {
default: "arcade",
arcade: {
debug: false,
},
},
};

var player; //player
var playerSpeed = 200;
var distance;
var target = new Phaser.Math.Vector2();

var candyTarget = new Phaser.Math.Vector2();

var game = new Phaser.Game(config);
Loading

0 comments on commit 7fa81af

Please sign in to comment.