Skip to content

최신으로 갱신 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
dfd6d75
Merge pull request #1 from Songhun/master
Songhun Oct 28, 2012
7983686
fixed invalid assignment operators
ragingwind Nov 1, 2012
fd38925
Add GamePad
Songhun Nov 1, 2012
f596766
merge
Songhun Nov 3, 2012
282962d
add cbox listener event APIs
ragingwind Nov 3, 2012
4d971f3
add cbox event handler to backbone.keyboard
ragingwind Nov 3, 2012
96710de
add key type(down/up)
ragingwind Nov 3, 2012
8ce4e0b
remove unless files
ragingwind Nov 5, 2012
5afcaa2
new version to slider view
ragingwind Nov 5, 2012
37274c8
add new game image
ragingwind Nov 5, 2012
214f6f4
add android robot logo
ragingwind Nov 5, 2012
cc49369
add jquery.transition.js
ragingwind Nov 5, 2012
b074aea
add jquery.transition.js
ragingwind Nov 5, 2012
a1f6ce2
whole new version home screen
ragingwind Nov 5, 2012
0747fe9
rearrange games list to new version home screen
ragingwind Nov 5, 2012
26e5704
change event name box to game
ragingwind Nov 5, 2012
b54b2dc
modify arguments of event handler
ragingwind Nov 5, 2012
561080f
disable opacity animation
ragingwind Nov 5, 2012
352d445
remove box border
ragingwind Nov 5, 2012
6766749
arrange reflect code
ragingwind Nov 5, 2012
70920ec
1. fixed bug nacl
Songhun Nov 7, 2012
c9801e4
remove console
Songhun Nov 7, 2012
b98406e
1. add contents script for controll
Songhun Nov 8, 2012
0e1868a
make controller for games
Songhun Nov 8, 2012
fd7afcb
change direction of keyboard
ragingwind Nov 9, 2012
bdb6bee
Add library
Songhun Nov 10, 2012
2d4a080
Merge branch 'master' of github.com:CboxConsole/Cbox
ragingwind Nov 10, 2012
a0850a4
add breakout game
ragingwind Nov 10, 2012
57590f7
move games to config.js
ragingwind Nov 12, 2012
bc01530
add config.js
ragingwind Nov 12, 2012
8db6c64
breakout: remove inside version game
ragingwind Nov 12, 2012
7007c05
cbox: content scripts divide into two sections per event
ragingwind Nov 12, 2012
746b67e
add config file to easy test
ragingwind Nov 12, 2012
02eb921
breakout: add game libs
ragingwind Nov 12, 2012
1c913a4
change indent
ragingwind Nov 14, 2012
fb6919c
move event code to homescreen.js
ragingwind Nov 14, 2012
522ec37
add edutorconfig
ragingwind Nov 14, 2012
ccce05e
prevent key event, game is running.
ragingwind Nov 14, 2012
f6de917
remove cbox logo on top,left
ragingwind Nov 14, 2012
e71779e
add slide sound effect
ragingwind Nov 14, 2012
52fbff9
fixed multiple executing
ragingwind Nov 14, 2012
3e05ae1
add new slide images
ragingwind Nov 14, 2012
49269df
changed ignore
Songhun Nov 14, 2012
32a6ea4
fixed contorller
Songhun Nov 17, 2012
bc871ec
change banners
ragingwind Nov 17, 2012
800da9a
fixed contorller
Songhun Nov 17, 2012
f3f009c
Update README.md
Songhun Nov 19, 2012
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
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# editorconfig.org
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
.idea
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CboxLauncher
============

Cbox의 기본이 되는 Launcher 입니다.
Cbox의 기본이 되는 Launcher 입니다.
# Prototype버전이며, v0.2로 다시 뵙겠습니다.
56 changes: 28 additions & 28 deletions _locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"prompt_for_name": {
"message": "What's your name?",
"description": "Ask for the user's name"
},
"hello": {
"message": "Hello, $USER$",
"description": "Greet the user",
"placeholders": {
"user": {
"content": "$1",
"example": "Cira"
}
}
},
"bye": {
"message": "Goodbye, $USER$. Come back to $OUR_SITE$ soon!",
"description": "Say goodbye to the user",
"placeholders": {
"our_site": {
"content": "Example.com"
},
"user": {
"content": "$1",
"example": "Cira"
}
}
}
{
"prompt_for_name": {
"message": "What's your name?",
"description": "Ask for the user's name"
},
"hello": {
"message": "Hello, $USER$",
"description": "Greet the user",
"placeholders": {
"user": {
"content": "$1",
"example": "Cira"
}
}
},
"bye": {
"message": "Goodbye, $USER$. Come back to $OUR_SITE$ soon!",
"description": "Say goodbye to the user",
"placeholders": {
"our_site": {
"content": "Example.com"
},
"user": {
"content": "$1",
"example": "Cira"
}
}
}
}
56 changes: 28 additions & 28 deletions _locales/ko/messages.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"prompt_for_name": {
"message": "What's your name?",
"description": "Ask for the user's name"
},
"hello": {
"message": "Hello, $USER$",
"description": "Greet the user",
"placeholders": {
"user": {
"content": "$1",
"example": "Cira"
}
}
},
"bye": {
"message": "Goodbye, $USER$. Come back to $OUR_SITE$ soon!",
"description": "Say goodbye to the user",
"placeholders": {
"our_site": {
"content": "Example.com"
},
"user": {
"content": "$1",
"example": "Cira"
}
}
}
images{
"prompt_for_name": {
"message": "What's your name?",
"description": "Ask for the user's name"
},
"hello": {
"message": "Hello, $USER$",
"description": "Greet the user",
"placeholders": {
"user": {
"content": "$1",
"example": "Cira"
}
}
},
"bye": {
"message": "Goodbye, $USER$. Come back to $OUR_SITE$ soon!",
"description": "Say goodbye to the user",
"placeholders": {
"our_site": {
"content": "Example.com"
},
"user": {
"content": "$1",
"example": "Cira"
}
}
}
}
Binary file removed games/breakout.jpg
Binary file not shown.
Binary file added games/breakout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added games/cboxtech.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added games/cboxtest.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed games/dkingkong.jpg
Binary file not shown.
Binary file removed games/garaga.gif
Binary file not shown.
Binary file removed games/padv.jpg
Binary file not shown.
Binary file added games/penguin-adv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed games/ramface.jpg
Binary file not shown.
Binary file removed games/smario.jpg
Binary file not shown.
Binary file added games/sugarpang.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/android-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 9 additions & 10 deletions main.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,22 @@
<script type="text/javascript" src="static/jquery.js"></script>
<script type="text/javascript" src="static/underscore.js"></script>
<script type="text/javascript" src="static/backbone.js"></script>
<script type="text/javascript" src="static/pubsub.js"></script>
<script type="text/javascript" src="static/cbox.sdk.js"></script>
<script type="text/javascript" src="static/backbone.tv.keyevent.js"></script>
<script type="text/javascript" src="static/jquery.transition.min.js"></script>
<script type="text/javascript" src="static/game-launcher.js"></script>
<script type="text/javascript" src="static/homescreen.js"></script>
<script type="text/javascript" src="static/config.js"></script>
<script type="text/javascript" src="static/main.js"></script>
</head>
<body>

<div id="osx-container">
<div id="osx-modal-content">
<div id="osx-modal-title">Connect Game Controllers</div>
<div class="close"><a href="#" class="simplemodal-close">x</a></div>
<div id="osx-modal-data">
Click button for connecting controllers.
<p><button id="listener" class="simplemodal-close">Connect</button></p>
</div>
</div>
<div id="listenerWebSocket">
<embed name="nacl_module"
id="websocket"
width=0 height=0
src="static/websocket/websocket.nmf"
type="application/x-nacl" />
</div>
</body>
</html>
28 changes: 26 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,32 @@
"128": "chrome-grey-128.png"
}
},
"permissions": [
"tabs", "http://*/*","https://*/*"
],
"update_url" : "http://localhost:8888/",
"background": {
"scripts": ["static/background.js"]
}
"scripts": ["static/background.js"]
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"run_at": "document_start",
"js": ["static/jquery.js",
"static/libs/collie.min.js",
"static/libs/cocos2d.js",
"static/libs/ranking.js"
],
"all_frames":true
},
{
"matches": ["<all_urls>"],
"run_at": "document_end",
"js": [
"static/pubsub.js",
"static/cbox.controller.js"
],
"all_frames":true
}
]
}
Binary file added sounds/slide.mp3
Binary file not shown.
54 changes: 49 additions & 5 deletions static/backbone.tv.keyevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@
},
trigger: function(keyevent) {
// the events can handle that occurred at body element only.
if (!(keyevent.srcElement instanceof HTMLBodyElement)) return this;

// if (!(keyevent.srcElement instanceof HTMLBodyElement)) return this;
var r = KeyEventListener.responder()
, events = KeyEventListener._hotkeys[keyevent.which];

Expand All @@ -125,7 +124,7 @@
on: function(events, callback, context) {
var keyEvents = this.keyEvents || (this.keyEvents = {})
, hotKeyEvents = KeyEventListener._hotkeys || (KeyEventListener._hotkeys = {})
, event;
, event;

events = events.split(/\s+/);
while (event = events.shift()) {
Expand Down Expand Up @@ -162,8 +161,53 @@

$(document).ready(function() {
// register key event.
document.body.addEventListener('keyup', Backbone.KeyEventListener.trigger);
document.body.addEventListener('keydown', Backbone.KeyEventListener.trigger);

var debug = false;
if (debug) {
document.body.addEventListener('keyup', Backbone.KeyEventListener.trigger);
document.body.addEventListener('keydown', Backbone.KeyEventListener.trigger);
}

cbox.previousEvent = {
pX1: 0,
pY1: 0
}

cbox.addEventListener(function(event, context, cbox) {
if (event.type != 'Down') return;

var keycode = undefined;
if (cbox.previousEvent.pX1 < event.pX1)
keycode = 39;
else if (cbox.previousEvent.pX1 > event.pX1)
keycode = 37;
if (cbox.previousEvent.pY1 < event.pY1)
keycode = 40;
else if (cbox.previousEvent.pY1 > event.pY1)
keycode = 38;
else if (event.btnA)
keycode = 13;
else if (event.btnB)
keycode = 27;

// hard copy events
cbox.previousEvent.pX1 = event.pX1;
cbox.previousEvent.pY1 = event.pY1;
cbox.previousEvent.type = event.type;

if (keycode) {
var ke = document.createEvent("KeyboardEvent");
// Chromium Hack, http://goo.gl/QNwqH
Object.defineProperty(ke, 'keyCode', {get : function() {return this.keyCodeVal;}});
Object.defineProperty(ke, 'which', {get : function() {return this.keyCodeVal;}});

ke.initKeyboardEvent(event.type == 'Down' ? 'keydown' : 'keyup',
true, true, null, false, false, false, false, keycode, keycode);
ke.keyCodeVal = keycode;

Backbone.KeyEventListener.trigger(ke);
}
});
});


Expand Down
17 changes: 17 additions & 0 deletions static/cbox.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Created with PyCharm.
* User: songhun
* Date: 11/8/12
* Time: 3:37 PM
* To change this template use File | Settings | File Templates.
*/


var gameScript = $("#cboxscript").html();
eval(gameScript);

$(function(){
pubsub.sub("controlls",function(msg){
cboxgame.fireEvent(msg.data);
});
});
Loading