Initial commit, no data is really correct.
After Width: | Height: | Size: 465 B |
After Width: | Height: | Size: 586 B |
After Width: | Height: | Size: 573 B |
After Width: | Height: | Size: 472 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 439 B |
After Width: | Height: | Size: 560 B |
After Width: | Height: | Size: 587 B |
|
@ -0,0 +1,14 @@
|
||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Game</title>
|
||||||
|
<script src="Oversimplified.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<canvas style="border:solid 1px black;" id="game">
|
||||||
|
Your browser is really old, dude - no canvas support! Update this thing!
|
||||||
|
</canvas>
|
||||||
|
<div id="audio"></div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,9 @@
|
||||||
|
var ct_up = OS.C.Add("WASD Up", OS.Keycode.w);
|
||||||
|
var ct_left = OS.C.Add("WASD Left", OS.Keycode.a);
|
||||||
|
var ct_down = OS.C.Add("WASD Down", OS.Keycode.s);
|
||||||
|
var ct_right = OS.C.Add("WASD Right", OS.Keycode.d);
|
||||||
|
|
||||||
|
var ct_shift = OS.C.Add("Shift", OS.Keycode.shift);
|
||||||
|
var ct_space = OS.C.Add("Space", OS.Keycode.space);
|
||||||
|
|
||||||
|
function loadControls () {}
|
|
@ -0,0 +1,8 @@
|
||||||
|
var Game = {};
|
||||||
|
G = Game;
|
||||||
|
|
||||||
|
G.pixelSize = 4;
|
||||||
|
G.player = {};
|
||||||
|
G.map = {};
|
||||||
|
|
||||||
|
function loadGameManager () {}
|
|
@ -0,0 +1,4 @@
|
||||||
|
function loadPrefabs() {
|
||||||
|
OS.AddScript("prefabs/shipPrefab.js");
|
||||||
|
OS.AddScript("prefabs/islandPrefab.js");
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
var rm_TitleScreen = OS.R.Add("Default", OS.camera.width, OS.camera.height, "");
|
||||||
|
var rm_Ocean = OS.R.Add("Ocean", 64 * 1000 * G.pixelSize, 64 * 1000 * G.pixelSize, "");
|
||||||
|
|
||||||
|
function loadRooms() {
|
||||||
|
OS.AddScript("rooms/titleScreen.js");
|
||||||
|
OS.AddScript("rooms/oceanRoom.js");
|
||||||
|
|
||||||
|
OS.SetRoom(rm_TitleScreen);
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
function oceanRoom () {
|
||||||
|
// When room is loaded, explicitly set room to rm_Ocean, just in case "Default" doesn't work/is loaded too slowly
|
||||||
|
OS.SetRoom(rm_Ocean);
|
||||||
|
}
|
||||||
|
|
||||||
|
rm_Ocean.DoFirst = function () {
|
||||||
|
//Hide cursor when playing (only use if masking the cursor with another object)
|
||||||
|
//OS.canvas.style.cursor = "none";
|
||||||
|
|
||||||
|
// Create objects on room start. This is best practice unless you need persistent objects.
|
||||||
|
Game.player = this.AddObject(OS.P["UFO"]);
|
||||||
|
Game.ball = this.AddObject(OS.P["Ball"]);
|
||||||
|
Game.cowboys = Math.floor(RandomRange(5, 50));
|
||||||
|
for (var i = 0; i < Game.cowboys; i++) {
|
||||||
|
this.AddObject(OS.P["Cowboy"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_Ocean.Do = function () {
|
||||||
|
if (Game.cowboys <= 0) {
|
||||||
|
OS.SetRoom(rm_Ocean);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_Ocean.DrawAbove = function () {
|
||||||
|
// Draw the number of cowboys remaining
|
||||||
|
if (Game.ball !== null) {
|
||||||
|
OS.context.font = "18px Impact";
|
||||||
|
OS.context.fillText(Game.cowboys, 15, 30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_Ocean.DoLast = function () {
|
||||||
|
// Clear Objects on room exit. This is best practice unless you need persistent objects.
|
||||||
|
rm_Ocean.objects = {};
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
function titleScreen () {
|
||||||
|
// When room is loaded, explicitly set room to rm_TitleScreen, just in case "Default" doesn't work/is loaded too slowly
|
||||||
|
OS.SetRoom(rm_TitleScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
rm_TitleScreen.DoFirst = function () {
|
||||||
|
//Hide cursor when playing (only use if masking the cursor with another object)
|
||||||
|
//OS.canvas.style.cursor = "none";
|
||||||
|
|
||||||
|
// Create objects on room start. This is best practice unless you need persistent objects.
|
||||||
|
Game.player = this.AddObject(OS.P["UFO"]);
|
||||||
|
Game.ball = this.AddObject(OS.P["Ball"]);
|
||||||
|
Game.cowboys = Math.floor(RandomRange(5, 50));
|
||||||
|
for (var i = 0; i < Game.cowboys; i++) {
|
||||||
|
this.AddObject(OS.P["Cowboy"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_TitleScreen.Do = function () {
|
||||||
|
if (Game.cowboys <= 0) {
|
||||||
|
OS.SetRoom(rm_TitleScreen);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_TitleScreen.DrawAbove = function () {
|
||||||
|
// Draw the number of cowboys remaining
|
||||||
|
if (Game.ball !== null) {
|
||||||
|
OS.context.font = "18px Impact";
|
||||||
|
OS.context.fillText(Game.cowboys, 15, 30);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rm_TitleScreen.DoLast = function () {
|
||||||
|
// Clear Objects on room exit. This is best practice unless you need persistent objects.
|
||||||
|
rm_TitleScreen.objects = {};
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
OS.S.defaultStep = 1 / 120;
|
||||||
|
OS.S.SetCamera((window.innerWidth < 500) ? window.innerWidth - 10 : 500, (window.innerHeight < 800) ? window.innerHeight - 10 : 800);
|
||||||
|
|
||||||
|
function start()
|
||||||
|
{
|
||||||
|
OS.AddScript("loadControls.js");
|
||||||
|
OS.AddScript("loadGamemanager.js");
|
||||||
|
OS.AddScript("loadPrefabs.js");
|
||||||
|
OS.AddScript("loadRooms.js");
|
||||||
|
}
|