Skip to content

sample RunSnailRun game, works on Tizen #252

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 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
46 changes: 46 additions & 0 deletions games/RunSnailRun/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Cocos2D-X</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>json.validation.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.tizen.web.jslint.nature.JSLintBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.tizen.web.css.nature.CSSBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.tizen.web.project.builder.WebBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>json.validation.nature</nature>
<nature>org.tizen.web.jslint.nature.JSLintNature</nature>
<nature>org.tizen.web.css.nature.CSSNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.tizen.web.project.builder.WebNature</nature>
</natures>
</projectDescription>
Binary file added games/RunSnailRun/.sdk_delta.info
Binary file not shown.
11 changes: 11 additions & 0 deletions games/RunSnailRun/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" xmlns:tizen="http://tizen.org/ns/widgets"
id="http://yourdomain/Run_Snail_Run" version="0.2.1" viewmodes="fullscreen">
<icon src="icon.png" />
<tizen:application id="DaDqOlnv04.RunSnailRun" package="DaDqOlnv04" required_version="2.1"/>
<content src="index.html" />
<name>Run Snail Run</name>
<tizen:setting screen-orientation="landscape"
/>
<tizen:privilege name="http://tizen.org/privilege/power" />
</widget>
82 changes: 82 additions & 0 deletions games/RunSnailRun/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Eric Meyer's Reset CSS v2.0 (http://meyerweb.com/eric/tools/css/reset/)
* http://cssreset.com
*/
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video
{
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section
{
display: block;
}

body {
line-height: 1;
}

ol,ul {
list-style: none;
}

blockquote,q {
quotes: none;
}

blockquote:before,blockquote:after,q:before,q:after {
content: '';
content: none;
}

table {
border-collapse: collapse;
border-spacing: 0;
}

#wood {
background-image: url(../images/border_wood_pattern.png);
background-repeat: repeat;
width: 1280px;
height: 720px;
}

#container {
height:45px;
line-height:45px;
}

#imageLogo {
float: left;
margin-top: 5px;
margin-left: 10px;
}

#timeLeft {
font-family: Tahoma;
font-weight: bold;
color: #fead06;
text-shadow: 0.03em 0.03em #38210a;
float: right;
margin-right: 10px;
}

#Cocos2dGameContainer {
clear: both;
margin-left: 10px;
}

.count {
font-size:36px;
float:left;
}
.sec{
float:right;
padding-left:10px;
font-size:25px;
}
Binary file added games/RunSnailRun/icon.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/RunSnailRun/images/CloseNormal.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/RunSnailRun/images/CloseSelected.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/RunSnailRun/images/HelloWorld.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/RunSnailRun/images/border_wood_pattern.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/RunSnailRun/images/favicon.ico
Binary file not shown.
Binary file added games/RunSnailRun/images/forward.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/RunSnailRun/images/game_logo.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/RunSnailRun/images/ground.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/RunSnailRun/images/hedgehog.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/RunSnailRun/images/lettuce.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/RunSnailRun/images/snail.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/RunSnailRun/images/splash/bg.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/RunSnailRun/images/splash/hedgehog.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/RunSnailRun/images/splash/logo.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/RunSnailRun/images/splash/snail.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions games/RunSnailRun/images/tiledMeadow.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="42" height="22" tilewidth="30" tileheight="30">
<tileset firstgid="1" name="lettuce" tilewidth="30" tileheight="30">
<image source="lettuce.png" width="30" height="30"/>
</tileset>
<tileset firstgid="2" name="ground" tilewidth="30" tileheight="30">
<image source="ground.png" width="30" height="30"/>
</tileset>
<layer name="Background" width="42" height="22">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAA+3DwQkAAAwDoSP7D90l+lRw1VRVVfX5AdD9n3ZwDgAA
</data>
</layer>
<objectgroup name="hedgehog" width="42" height="22">
<object name="StartPosition" x="698" y="240"/>
</objectgroup>
<layer name="collidable" width="42" height="22">
<data encoding="base64" compression="gzip">
H4sIAAAAAAAAA+3WUQoAIQgE0Lz/pbuAok6pKQ30tZWvqKW1eoWqAcZMdlasDXVmW6OdxDQkJ07LWK9T+s7NY5kL7Ys6o5PlvHG2vPXQcd7zeJLpzuw634nX4fpGOJF/r2Z68V30ilPb687OikQ6pbuB3JVbb7oO2annGc9wDgAA
</data>
</layer>
<objectgroup name="snails" width="42" height="22">
<object x="35" y="60"/>
<object x="35" y="120"/>
<object x="180" y="120"/>
<object x="150" y="60"/>
<object x="120" y="510"/>
<object x="120" y="570"/>
<object x="90" y="630"/>
<object x="120" y="390"/>
<object x="713" y="265"/>
<object x="901" y="28"/>
<object x="903" y="104"/>
<object x="822" y="68"/>
<object x="965" y="150"/>
<object x="964" y="100"/>
<object x="1039" y="126"/>
<object x="722" y="67"/>
<object x="816" y="441"/>
<object x="527" y="591"/>
<object x="454" y="448"/>
<object x="448" y="488"/>
<object x="372" y="512"/>
<object x="239" y="295"/>
<object x="500" y="278"/>
<object x="500" y="368"/>
<object x="607" y="41"/>
<object x="887" y="333"/>
<object x="812" y="353"/>
<object x="1119" y="473"/>
<object x="1056" y="313"/>
<object x="928" y="466"/>
</objectgroup>
</map>
Binary file added games/RunSnailRun/images/tizen_32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions games/RunSnailRun/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

<!-- THIS viewport setting works on both U1HD and M0 -->
<meta name="viewport" content="initial-scale=0.5, maximum-scale=0.5">

<!-- THIS viewport setting works only on M0 -->
<!-- <meta name="viewport"
content="width=1280, initial-scale=1, maximum-scale=1"> -->

<title>Run Snail Run</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script src="js/lib/external/jquery-1.8.2.js"></script>
<script src="js/lib/tizen/tizen.js"></script>
<script src="js/lib/tizen/tizen.logger.js"></script>
<script src="js/lib/tizen/tizen.view.js"></script>

<!-- This file includes cocos2d loader. You should add into it all application files, that you want to load after cocos2d -->
<script src="./js/cocos2d.js"></script>

</head>

<body>
<div id="wood">
<div id='container'>
<img id="imageLogo" src="images/game_logo.png">
<p id="timeLeft"></p>
</div>
<canvas id="gameCanvas" width="1260" height="660"></canvas>
</div>
</body>
</html>
37 changes: 37 additions & 0 deletions games/RunSnailRun/js/classes/Application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"use strict";
classes.Application = cc.Application.extend({
config : document.ccConfig,
ctor : function(scene) {
this._super();
this.startScene = scene;
cc.COCOS2D_DEBUG = this.config['COCOS2D_DEBUG'];
cc.setup(this.config['tag']);
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
},
applicationDidFinishLaunching : function() {
var that = this;
// initialize director
var director = cc.Director.getInstance();

// enable High Resource Mode(2x, such as iphone4) and maintains low
// resource on other devices.
// director->enableRetinaDisplay(true);

// turn on display FPS
director.setDisplayStats(this.config['showFPS']);

// set FPS. the default value is 1.0/60 if you don't call this
director.setAnimationInterval(1.0 / this.config['frameRate']);

// create a scene. it's an autorelease object

// load resources and run
cc.Loader.preload(game.config.resources, function() {
var startSceneInstance = new that.startScene();
director.runWithScene(startSceneInstance);
//game.setScene('intro', startSceneInstance);
});

return true;
}
});
37 changes: 37 additions & 0 deletions games/RunSnailRun/js/classes/Application.js~
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"use strict";
classes.Application = cc.Application.extend({
config : document.ccConfig,
ctor : function(scene) {
this._super();
this.startScene = scene;
cc.COCOS2D_DEBUG = this.config['COCOS2D_DEBUG'];
cc.setup(this.config['tag']);
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
},
applicationDidFinishLaunching : function() {
var that = this;
// initialize director
var director = cc.Director.getInstance();

// enable High Resource Mode(2x, such as iphone4) and maintains low
// resource on other devices.
// director->enableRetinaDisplay(true);

// turn on display FPS
director.setDisplayStats(this.config['showFPS']);

// set FPS. the default value is 1.0/60 if you don't call this
director.setAnimationInterval(1.0 / this.config['frameRate']);

// create a scene. it's an autorelease object

// load resources and run
cc.Loader.preload(game.config.resources, function() {
var startSceneInstance = new that.startScene();
director.replaceScene(startSceneInstance);
game.setScene('intro', startSceneInstance);
});

return true;
}
});
5 changes: 5 additions & 0 deletions games/RunSnailRun/js/classes/classes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* @namespace
*/
"use strict";
var classes = {};
Loading