Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

play and edit workflow

  • Loading branch information...
commit 6a7b1e26f33748eb0307e3b483ce81262dad848c 1 parent abf2dc1
@jomoho authored
View
0  .monitor
No changes.
View
12 static/css/style.css
@@ -237,9 +237,6 @@ a:hover{
#tools #settings img{
background-position: -96px -32px;
}
-#help-button img{
- background-position: -224px 0px;
-}
#home-button img{
background-position: -128px -32px;
}
@@ -252,6 +249,15 @@ a:hover{
#help-button img{
background-position: -224px -32px;
}
+#new-button img{
+ background-position: 0 -64px;
+}
+#reload-button img{
+ background-position: -32px -64px;
+}
+#list-button img{
+ background-position: -64px -64px;
+}
#sidebar{
position: absolute;
View
BIN  static/img/icons.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
5 static/js/editor.js
@@ -7,6 +7,7 @@ require(['jo/jo', 'jo/Game','jo/Camera', 'jo/Animation', 'Level', 'ioclient', 's
var editor = jo.editor = new Game({ name: '#canvas', fullscreen: true, fps: 30});
editor.setup(function(){
//preloading of the files we need
+ game.runSetup();
editor.load(['img/logo.png',
'img/player.png',
'img/tileset.png'], '/');
@@ -39,10 +40,10 @@ require(['jo/jo', 'jo/Game','jo/Camera', 'jo/Animation', 'Level', 'ioclient', 's
ioclient.sync('shift', editor.map, 'grid', true);
ioclient.sync('rename', editor.map, 'grid');
- ioclient.sync('post', editor.chat, 'chat', true);
-
+ ioclient.sync('post', editor.chat, 'chat', true);
$('#loading').hide();
+ $('#menu').fadeIn();
}
});
View
11 static/js/game/main.js
@@ -15,23 +15,18 @@ define(['../jo/jo',
'img/player_record.png',
'img/player_shadow.png',
'img/device.png',
- 'img/tileset.png'], '/js/game/');
+ 'img/tileset.png'], '/js/game/');
}, true);
game.ready(function(){
-// if(jo.dev){
-// jo.files.mute();
-// }
-
game.state = 'start';
game.cam = new jo.Camera();
- //game.ts = new jo.TileSet({tiles:[0,1,2,3, [{i:4, t:800},{i:5, t: 600}], 6],width: 64, height:64,sprite: jo.files.img.tileset});
game.ts={};
game.ts.solid = [0,1,2,3];
game.ts.start = 5;
game.ts.exit = 4;
-
+ game.removeAllObjects();
game.addObject('player', new Actor({name: 'player', position: new jo.Point(100, 64)}));
game.initLevel();
game.device= new jo.Animation([1,1,1], 80,42, jo.files.img.device);
@@ -92,7 +87,7 @@ define(['../jo/jo',
game.levelDone = function(){
//game.initLevel();
- alert('Level Done');
+ //alert('Level Done');
};
var recording = false;
View
31 static/js/menus.js → static/js/menu.js
@@ -4,8 +4,11 @@ $(document).ready(function(){
helpbutton = $('#help-button'),
playbutton = $('#play-button'),
editbutton = $('#edit-button'),
+ reloadbutton = $('#reload-button'),
buttons = $('.button');
+
+
buttons.each(function(vent, obj){
var o = $(obj), txt= o.attr('name');
if(o.hasClass('link')){
@@ -18,11 +21,14 @@ $(document).ready(function(){
o.append('<img src="/img/empty.png" width="32" height="32" alt="'+$(obj).attr('id')+'"/>').append(p);
p = o.find('span');
p.css({left: 8-(p.width()/2)});
- if(txt =='edit'){
- editbutton.hide();
- }
+
});
+ reloadbutton.hide();
+ editbutton.hide();
+ $('#menu').hide();
+
+
chatbutton.click(function(){
if(chatbutton.hasClass('hidden')){
$('#chat').show();
@@ -44,11 +50,20 @@ $(document).ready(function(){
playbutton.click(function(){
if($jo.state === 'edit'){
$jo.game.map = $jo.editor.map;
- $jo.game.runSetup();
+ if(!$jo.game.getObject('player')){
+ $jo.game.runReady();
+ }else{
+ $jo.game.run();
+ }
+
$jo.state = 'play';
console.log('go play');
+
playbutton.hide();
+
editbutton.show();
+ reloadbutton.show();
+
$('#sidebar').fadeOut();
}
});
@@ -57,11 +72,19 @@ $(document).ready(function(){
$jo.editor.run();
$jo.state = 'edit';
console.log('go edit');
+
editbutton.hide();
+ reloadbutton.hide();
+
playbutton.show();
$('#sidebar').fadeIn();
}
});
+ reloadbutton.click(function(){
+ if($jo.state === 'play'){
+ $jo.game.runReady();
+ }
+ });
$('#canvas').click(function(){
$('input').blur();
View
3  views/edit/index.jade
@@ -1,8 +1,5 @@
script( data-main='/js/editor', src='/js/require.js')
ul#menu!=partial('menu')
-#status
- #loading sync...
- #saved(style='display:none;') saved
ul#sidebar!= partial('sidebar')
#help(style='display:none;')!=partial('help');
#chat(style='display:none;')!=partial('chat');
View
3  views/edit/menu.jade
@@ -3,4 +3,5 @@ li#home-button(class='button link', name='home')
li#chat-button(class='button hidden', name='chat')
li#help-button(class='button hidden', name='help')
li#play-button(class='button', name='play')
-li#edit-button(class='button', name='edit')
+li#edit-button(class='button', name='edit')
+li#reload-button(class='button', name='reload')
View
3  views/edit/sidebar.jade
@@ -1,4 +1,7 @@
li.panel(name='tools')
+ #status
+ #loading sync...
+ #saved(style='display:none;') saved
h2 tools
ul#tools
li#drag.button
View
2  views/editor-layout.jade
@@ -14,5 +14,5 @@ html
script(type='text/javascript', src= '/js/jquery.js')
// script(type='text/javascript', src= '/js/plugins/jquery.form.js')
script(type='text/javascript', src= '/js/plugins/jquery.cookie.js')
- script(type='text/javascript', src= '/js/menus.js')
+ script(type='text/javascript', src= '/js/menu.js')
script!=googleAnalytics
View
2  views/game-layout.jade
@@ -14,5 +14,5 @@ html
script(type='text/javascript', src= '/js/jquery.js')
// script(type='text/javascript', src= '/js/plugins/jquery.form.js')
script(type='text/javascript', src= '/js/plugins/jquery.cookie.js')
- script(type='text/javascript', src= '/js/menus.js')
+ script(type='text/javascript', src= '/js/menu.js')
script!=googleAnalytics
Please sign in to comment.
Something went wrong with that request. Please try again.