Skip to content

Commit 1fb2289

Browse files
committed
add html templates for embeds
1 parent ca764af commit 1fb2289

File tree

9 files changed

+351
-27
lines changed

9 files changed

+351
-27
lines changed
-414 Bytes
Loading
1.01 KB
Loading

game-dev-ai/dist/bundle.r.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

game-dev-ai/dist/bundle.r.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

game-dev-ai/index.html

+121-21
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
<!doctype html>
2-
<html lang="eng">
2+
<html lang="en">
33
<head>
44
<meta charset="utf-8">
5-
<title>Game Development Artificial Intelligence Lessons</title>
6-
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<title>HTML5 Games | Easy Learn Tutorial | Free Programming Lessons</title>
8+
<link href="http://easylearntutorial.com/html5-games" rel="canonical"/>
9+
<link href="http://easylearntutorial.com/public/css/bootstrap.css" rel="stylesheet"/>
10+
<link href="http://easylearntutorial.com/public/css/main.css" rel="stylesheet"/>
11+
<link href="http://easylearntutorial.com/public/css/font-awesome.min.css" rel="stylesheet"/>
12+
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
13+
<script src="http://easylearntutorial.com/public/js/bootstrap.js"></script>
14+
<link href='http://easylearntutorial.com/favicon.ico' rel='icon' type='image/x-icon'/>
15+
<!--[if lt IE 9]> <script src="//oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> <script src="//oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script> <![endif]-->
716
<style>
8-
html, body {
9-
width: 100%;
10-
height: 100%;
11-
padding: 0;
12-
margin: 0;
13-
background: #eee;
14-
font-size: 12px;
15-
}
16-
canvas {
17-
display: block;
18-
margin: 50px auto;
19-
}
20-
2117
/* latin */
2218
@font-face {
2319
font-family: 'Press Start 2P';
@@ -26,23 +22,127 @@
2622
src: local('Press Start 2P'), local('PressStart2P-Regular'), url(asset/fonts/press-start-2p.woff2) format('woff2');
2723
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
2824
}
25+
26+
canvas {
27+
display: block;
28+
margin: 0 auto;
29+
}
2930
</style>
3031
</head>
3132
<body>
33+
<div class="navbar navbar-default navbar-fixed-top">
34+
<div class="container">
35+
<div class="navbar-header">
36+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span
37+
class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span></button>
38+
<a class="navbar-brand" href="/"><i class="fa fa-bookmark-o"></i></a>
3239

33-
<div id="assetLoader">
34-
<h1 style="font-family: 'Press Start 2P'">Game Development Course: GDC 221</h1>
40+
<div class="pull-right yt-widget hor-spacer hidden visible-xs">
41+
<div class="g-ytsubscribe" data-channel="easylearntutorial" data-layout="default"
42+
data-count="default"></div>
43+
</div>
44+
</div>
45+
<div class="navbar-collapse collapse">
46+
<ul class="nav navbar-nav navbar-right">
47+
<li class="1"><a href="/">Home</a></li>
48+
<li class="1"><a href="/series">Series</a></li>
49+
<li class="active"><a href="/html5-games">HTML5 Games</a></li>
50+
<li class="1"><a href="/about">About</a></li>
51+
<li class="1"><a href="/donate">Donate</a></li>
52+
<li class="yt-widget">
53+
<script src="https://apis.google.com/js/platform.js"></script>
54+
<div class="g-ytsubscribe" data-channel="easylearntutorial" data-layout="default"
55+
data-count="default"></div>
56+
</li>
57+
</ul>
58+
</div>
59+
<!--/.nav-collapse --> </div>
60+
</div>
61+
<div id="green">
62+
<div class="container">
63+
<div class="row">
64+
<div class="col-sm-4 centered"><img src="http://www.easylearntutorial.com/html5-games/gdc-221-introToAi/asset/img/gdc221-mascot.png" alt="GDC 221: Intro to AI" style="image-rendering: pixelated; width: 80%"></div>
65+
<div class="col-sm-8"><h1>GDC 221: Introduction to Artificial Intelligence</h1>
66+
<p>Game Development Course 221 introduces you to basic concepts related to AI that can be added to your games. The example game we've build to illustrate the concepts taught in this course is a metaphor for Capcom's Mega Man series for Nintendo's NES system.</p>
67+
<p>Each lesson has an accompanying level within the game that demonstrates the concept as a mini game (or an example of how it could be used in a real game).</p>
68+
</div>
69+
</div>
70+
</div>
3571
</div>
72+
<div class="container">
73+
<div class="row centered mt grid"><h3>PLAY ONLINE NOW</h3>
3674

37-
<script src="node_modules/phaser/dist/phaser.js"></script>
75+
<div class="mt"></div>
76+
<div class="col-xm-12 centered">
77+
<div id="gdc221AssetsContainer"></div>
78+
<div id="gdc221Container" style="background: #000; width: 100%; height: 450px;"></div>
79+
<p><br/>
80+
<button class="btn btn-primary" id="play">Start Game</button>
81+
<button class="btn btn-info" disabled id="goFullScreen">Full screen</button>
82+
<a class="btn btn-link" href="/series/watch/57/2d-game-development-from-scratch">Watch course videos</a>
83+
<script>
84+
var startBtn = document.getElementById('play');
85+
var fsBtn = document.getElementById('goFullScreen');
86+
var elem = document.getElementById('gdc221Container');
87+
var canvas = elem.getElementsByTagName('canvas') || [null];
88+
89+
startBtn.addEventListener('click', function(){
90+
var script = document.createElement('script');
91+
script.src = 'http://easylearntutorial.com/html5-games/gdc-221-introToAi/dist/bundle.r.js';
92+
document.body.appendChild(script);
93+
fsBtn.removeAttribute('disabled');
94+
startBtn.setAttribute('disabled', true);
95+
});
96+
97+
fsBtn.addEventListener('click', function(){
98+
if (elem.requestFullscreen) {
99+
elem.requestFullscreen();
100+
} else if (elem.msRequestFullscreen) {
101+
elem.msRequestFullscreen();
102+
} else if (elem.mozRequestFullScreen) {
103+
elem.mozRequestFullScreen();
104+
} else if (elem.webkitRequestFullscreen) {
105+
elem.webkitRequestFullscreen();
106+
}
107+
});
108+
</script>
109+
</p>
110+
</div>
111+
<div class="clearfix"></div>
112+
</div>
113+
</div>
114+
<div id="f">
115+
<div class="container">
116+
<div class="row"><p>Copyright &copy; 2015 EasyLearnTutorial. All rights reserved.</p></div>
117+
</div>
118+
</div>
119+
120+
<script src="http://easylearntutorial.com/html5-games/gdc-221-introToAi/node_modules/phaser/dist/phaser.js"></script>
38121
<script>
39-
var assetLoader = document.getElementById('assetLoader');
122+
var assetLoader = document.getElementById('gdc221AssetsContainer');
40123
assetLoader.style.position = 'absolute';
41124
assetLoader.style.top = '-999px';
42125
assetLoader.style.width = '1px';
43126
assetLoader.style.height = '1px';
44127
assetLoader.style.overflow = 'hidden';
45128
</script>
46-
<script src="dist/bundle.r.js"></script>
129+
<script>
130+
131+
(function (i, s, o, g, r, a, m) {
132+
i['GoogleAnalyticsObject'] = r;
133+
i[r] = i[r] || function () {
134+
(i[r].q = i[r].q || []).push(arguments)
135+
}, i[r].l = 1 * new Date();
136+
a = s.createElement(o),
137+
m = s.getElementsByTagName(o)[0];
138+
a.async = 1;
139+
a.src = g;
140+
m.parentNode.insertBefore(a, m)
141+
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
142+
143+
ga('create', 'UA-36191661-1', 'auto');
144+
ga('send', 'pageview');
145+
146+
</script>
47147
</body>
48148
</html>

game-dev-ai/src/main.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ Test.prototype = {
100100
};
101101
*/
102102

103-
const game = new Phaser.Game(800, 450, Phaser.AUTO, 'elt', null, false, false);
103+
const game = new Phaser.Game(800, 450, Phaser.AUTO, 'gdc221Container', false, false);
104+
105+
game.scale.fullScreenScaleMode = Phaser.ScaleManager.EXACT_FIT;
106+
104107
game.state.add('Placeholder', require('./scenes/Placeholder'));
105108
game.state.add('Intro', require('./scenes/Copyright'));
106109
game.state.add('Main', require('./scenes/Main'));

game-dev-ai/src/scenes/Main.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ function Main() {
1919
}
2020

2121
Main.prototype.preload = function(){
22-
this.load.audio('bgMusic', ['/asset/audio/mm3-intro-yt.HeVva6ddNAc.danielsymphonies.mp3']);
23-
this.load.atlasJSONHash('atlas', '/asset/img/main-screen-0.0.3.png', '/asset/sprites/main-screen.json');
22+
this.load.audio('bgMusic', ['asset/audio/mm3-intro-yt.HeVva6ddNAc.danielsymphonies.mp3']);
23+
this.load.atlasJSONHash('atlas', 'asset/img/main-screen-0.0.3.png', 'asset/sprites/main-screen.json');
2424
};
2525

2626
Main.prototype.create = function () {

0 commit comments

Comments
 (0)