Skip to content

Commit

Permalink
Updated to version 1.2.4 from premium repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Irrelon committed Oct 7, 2013
1 parent 87fbfc2 commit 62f7d40
Show file tree
Hide file tree
Showing 128 changed files with 6,879 additions and 1,004 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,11 @@ pip-log.txt
.DS_Store

.idea

.old*
.deploy*

npm-debug.log

# Ignore all node_modules
server/node_modules*
4 changes: 2 additions & 2 deletions blank_game/ClientConfig.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
var igeClientConfig = {
include: [
/* Your custom game JS scripts */
'./gameClasses/ClientNetworkEvents.js',
'./gameClasses/Rotator.js',
//'./gameClasses/MyCustomClassFile.js',

/* Standard game scripts */
'./client.js',
'./index.js'
Expand Down
80 changes: 20 additions & 60 deletions blank_game/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ var Client = IgeClass.extend({
ige.showStats(1);

// Load our textures
var self = this,
gameTexture = [];

this.obj = [];

ige.input.debug(true);

// Load the fairy texture and store it in the gameTexture array
gameTexture[0] = new IgeTexture('../ige_prototype/examples/assets/textures/sprites/fairy.png');

// Load a smart texture
gameTexture[1] = new IgeTexture('../ige_prototype/examples/assets/textures/smartTextures/simpleBox.js');
var self = this;
this.gameTextures = {};

// Load a game texture here
//this.gameTextures.myTexture = new IgeTexture('./assets/somePathToImage.png');

///////////////////////////////////////////////////////////////////////////////
// *** PLEASE READ - BLANK PROJECT RUNNING DETAILS ***
///////////////////////////////////////////////////////////////////////////////
// The engine will wait for your textures to load before it starts because
// of the code below waiting for an "on('texturesLoaded')" before executing.
// The problem is there are no textures loaded because this is a blank project
// so if you run this from the index.html the loading symbol will spin forever.
// I've added an example line (line 11) to show how to load at least one
// texture into memory but you'll have to provide an image file for it :)
///////////////////////////////////////////////////////////////////////////////

// Wait for our textures to load before continuing
ige.on('texturesLoaded', function () {
Expand All @@ -26,54 +30,10 @@ var Client = IgeClass.extend({
ige.start(function (success) {
// Check if the engine started successfully
if (success) {
// Create the scene
self.scene1 = new IgeScene2d()
.id('scene1');

// Create the main viewport and set the scene
// it will "look" at as the new scene1 we just
// created above
self.vp1 = new IgeViewport()
.id('vp1')
.autoSize(true)
.scene(self.scene1)
.drawBounds(true)
.mount(ige);

// Create an entity and mount it to the scene
// (the class Rotator is declared in ./gameClasses/Rotator.js)
self.obj[0] = new Rotator()
.id('fairy1')
.depth(1)
.width(100)
.height(100)
.texture(gameTexture[0])
.translateTo(0, 0, 0)
.mount(self.scene1);

// Create a second rotator entity and mount
// it to the first one at 0, 50 relative to the
// parent
self.obj[1] = new Rotator()
.id('fairy2')
.depth(1)
.width(50)
.height(50)
.texture(gameTexture[0])
.translateTo(0, 50, 0)
.mount(self.obj[0]);

// Create a third rotator entity and mount
// it to the first on at 0, -50 relative to the
// parent, but assign it a smart texture!
self.obj[2] = new Rotator()
.id('simpleBox')
.depth(1)
.width(50)
.height(50)
.texture(gameTexture[1])
.translateTo(0, -50, 0)
.mount(self.obj[0]);
// Add base scene data
ige.addGraph('IgeBaseScene');

// CREATE SOME ENTITIES AND WHOTNOT HERE
}
});
});
Expand Down
26 changes: 25 additions & 1 deletion blank_game/css/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ body {
position: absolute;
top: 4px;
left: 4px;
width: 400px;
width: 300px;
height: 200px;
background-color: rgba(7, 20, 25, 0.9);
font-family: Verdana, Tahoma;
Expand All @@ -191,17 +191,21 @@ body {
-moz-user-select: none;
cursor: default;
z-index: 200000;
overflow: auto;
}

#igeSgTree ul {
list-style: none;
margin: 0;
padding: 0px 0px 0px 14px;
white-space: nowrap;
}

#igeSgTree li {
cursor: pointer;
margin: 3px;
white-space: nowrap;
padding-right: 10px;
}

#igeSgTree li.selected {
Expand All @@ -213,6 +217,7 @@ body {
}

#igeSgConsoleHolder {
display: none;
position: absolute;
left: 410px;
top: 4px;
Expand Down Expand Up @@ -242,4 +247,23 @@ body {
display: none;
margin-top: 4px;
margin-bottom: 4px;
}

#igeSgEditorRoot {
display: block;
position: absolute;
bottom: 4px;
right: 4px;
width: 400px;
height: 24px;
background-color: rgba(7, 20, 25, 0.9);
font-family: Verdana, Tahoma;
font-size: 11px;
color: #ffffff;
text-shadow: 1px 1px 3px #000000;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
cursor: default;
z-index: 200000;
}
17 changes: 0 additions & 17 deletions blank_game/gameClasses/Rotator.js

This file was deleted.

4 changes: 2 additions & 2 deletions blank_game/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<link href="./css/default.css" rel="stylesheet" type="text/css" />

<!-- Isogenic Loader -->
<script type="text/javascript">var igeRoot = '../ige_prototype/engine/';</script>
<script type="text/javascript" src="../ige_prototype/engine/loader.js"></script>
<script type="text/javascript">var igeRoot = '../ige/engine/';</script>
<script type="text/javascript" src="../ige/engine/loader.js"></script>
</head>
<body>
<div class="igeLoading loadingFloat">
Expand Down
12 changes: 12 additions & 0 deletions blank_game_multiplayer/ClientConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var igeClientConfig = {
include: [
/* Your custom game JS scripts */
//'./gameClasses/MyClassFile.js',

/* Standard game scripts */
'./client.js',
'./index.js'
]
};

if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = igeClientConfig; }
7 changes: 7 additions & 0 deletions blank_game_multiplayer/ServerConfig.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var config = {
include: [
//{name: 'MyClassName', path: './gameClasses/MyClassFileName'},
]
};

if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = config; }
13 changes: 13 additions & 0 deletions blank_game_multiplayer/assets/PlayerTexture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var image = {
render: function (ctx, entity) {
// Draw the player entity
ctx.strokeStyle = 'rgba(255, 0, 0, 1)';
ctx.beginPath();
ctx.moveTo(0, -entity._geometry.y2);
ctx.lineTo(entity._geometry.x2, entity._geometry.y2);
ctx.lineTo(0, entity._geometry.y2 - 5);
ctx.lineTo(-entity._geometry.x2, entity._geometry.y2);
ctx.lineTo(0, -entity._geometry.y2);
ctx.stroke();
}
};
52 changes: 52 additions & 0 deletions blank_game_multiplayer/client.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
var Client = IgeClass.extend({
classId: 'Client',

init: function () {
//ige.timeScale(0.1);
ige.showStats(1);

// Load our textures
var self = this;

// Enable networking
ige.addComponent(IgeNetIoComponent);

// Create the HTML canvas
ige.createFrontBuffer(true);

// Load the textures we want to use
this.textures = {
ship: new IgeTexture('./assets/PlayerTexture.js')
};

ige.on('texturesLoaded', function () {
// Ask the engine to start
ige.start(function (success) {
// Check if the engine started successfully
if (success) {
// Start the networking (you can do this elsewhere if it
// makes sense to connect to the server later on rather
// than before the scene etc are created... maybe you want
// a splash screen or a menu first? Then connect after you've
// got a username or something?
ige.network.start('http://localhost:2000', function () {
// Setup the network stream handler
ige.network.addComponent(IgeStreamComponent)
.stream.renderLatency(80) // Render the simulation 160 milliseconds in the past
// Create a listener that will fire whenever an entity
// is created because of the incoming stream data
.stream.on('entityCreated', function (entity) {
self.log('Stream entity created with ID: ' + entity.id());

});

// Load the base scene data
ige.addGraph('IgeBaseScene');
});
}
});
});
}
});

if (typeof(module) !== 'undefined' && typeof(module.exports) !== 'undefined') { module.exports = Client; }
Loading

0 comments on commit 62f7d40

Please sign in to comment.