Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions game/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Flying Cube Game</title>

<link rel="stylesheet" href="game/src/style.css">

<style>
html,
body {
Expand Down
Binary file added game/src/AttackGraffiti.ttf
Binary file not shown.
22 changes: 18 additions & 4 deletions game/src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,22 @@ const gravity = new BABYLON.Vector2(0, -9.8);
const flightForce = 5; // The amount of force applied when the "fly" button is pressed

const greetings = [
'It\'s a bird!',
'It\'s a plane!',
'1000% more Cube!',
'A Whole New Dimension!'
'It\'s a bird!',
'It\'s an airplane!',
'1001% more Cube!',
'A Whole New Dimension!',
'You\'ve Been Cubed!',
'Don\'t be a Square!',
'Blastoff!',
'Get In Shape!',
'Error 404 CUBE Not Found!',
'Drop the Cube!',
'Houston, we have a cube problem!',
'Up Up and Away!',
'The Building Blocks Of Flight!',
'Simple Geometry!',
'I Believe I Can Cube!',
'To Cube or not to Cube!',
'It\'s hip to be square!',
'Hello, Hacktoberfest',
];
2 changes: 1 addition & 1 deletion game/src/hud.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var createHud = function() {

// Create a Text Block that can display the current score
scoreText = new BABYLON.GUI.TextBlock();
scoreText.fontFamily = "Comic Sans, Comic Sans MS";
scoreText.fontFamily = "myFirstFont";
scoreText.color = "white";
scoreText.fontSize = 48;
scoreText.verticalAlignment = BABYLON.GUI.TextBlock.VERTICAL_ALIGNMENT_TOP;
Expand Down
1 change: 1 addition & 0 deletions game/src/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class Player extends GameObject {
const boxOptions = {width: 1, height: 1, depth: 1};
this.playerMesh = BABYLON.MeshBuilder.CreateBox("bird", boxOptions, scene);
this.playerMaterial = new BABYLON.StandardMaterial("Player Material", scene);
this.playerMaterial.diffuseTexture = new BABYLON.Texture("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTcKAv4NILPrbMI6u3iYQHGPtwyuwekxSypzw&usqp=CAU", scene);
this.playerMesh.material = this.playerMaterial;
this.playerMesh.material.diffuseColor = BABYLON.Color3.White();
}
Expand Down
4 changes: 4 additions & 0 deletions game/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@font-face {
font-family: myFirstFont;
src: url(./AttackGraffiti.ttf);
}