Skip to content
Browse files

adding background, waves and boat

  • Loading branch information...
1 parent 5785dfe commit 1c503554af80074ea2effe8823d3957835938778 @luizgustavolino luizgustavolino committed
Showing with 871 additions and 15 deletions.
  1. +4 −1 Classes/AppDelegate.js
  2. +39 −0 Classes/Capn.js
  3. +34 −9 Classes/GameScene.js
  4. +18 −1 Classes/PirateMutiny.js
  5. +44 −0 Classes/SpriteUtils.js
  6. +144 −0 Classes/World.js
  7. +566 −0 Resources/pm.plist
  8. BIN Resources/pm.png
  9. +7 −4 cocos2d.js
  10. +15 −0 server.py
View
5 Classes/AppDelegate.js
@@ -13,7 +13,10 @@ cc.AppDelegate = cc.Application.extend({
var director = cc.Director.sharedDirector();
director.setDisplayFPS(false);
- director.setAnimationInterval(1.0 / 60);
+ director.setAnimationInterval(1.0/32.0);
+
+ var spriteCache = cc.SpriteFrameCache.sharedSpriteFrameCache();
+ spriteCache.addSpriteFramesWithFile("Resources/pm.plist", "Resources/pm.png");
var scene = GameScene.scene();
director.runWithScene(scene);
View
39 Classes/Capn.js
@@ -0,0 +1,39 @@
+var Capn = cc.Sprite.extend({
+
+ init: function(){
+ this._super();
+
+ // IDLE ANIMATION
+ var animFrames = [];
+ var str = "";
+ for (var i = 1; i < 5; i++) {
+ str = "capn_idle" + (i < 10 ? ("0" + i) : i) + ".png";
+ var frame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(str);
+ animFrames.push(frame);
+ }
+ var animation = cc.Animation.create(animFrames, 0.15);
+ cc.AnimationCache.sharedAnimationCache().addAnimation(animation, "capnIdle");
+
+ // RUN ANIMATION
+ var animCache = cc.AnimationCache.sharedAnimationCache();
+ var idle_anm = animCache.animationByName("capnIdle");
+ var animN = cc.Animate.create(idle_anm);
+ var repeat = cc.RepeatForever.create(animN);
+ this.runAction(repeat);
+
+ this.scheduleUpdate();
+
+ },
+
+ update:function(dt){
+
+ }
+
+});
+
+Capn.spriteWithSpriteFrameName = function (spriteFrameName) {
+ var pFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(spriteFrameName);
+ var sprite = new Capn();
+ sprite.initWithSpriteFrame(pFrame);
+ return sprite;
+};
View
43 Classes/GameScene.js
@@ -1,31 +1,56 @@
var GameScene = cc.Layer.extend({
- helloLabel:null,
-
+ waves: null,
+ wavesBG: null,
+ sky: null,
+ boat: null,
init:function () {
this._super();
var size = cc.Director.sharedDirector().getWinSize();
- this.helloLabel = cc.LabelTTF.create("Game layarrr!", "Arial", 28);
- this.helloLabel.setPosition(cc.ccp(size.width / 2, size.height - 40));
- this.addChild(this.helloLabel);
+
+ this.sky = new Sky();
+ this.sky.setPosition(cc.ccp(0, 30));
+ this.addChild(this.sky);
+
+ this.wavesBG = new WaterBG();
+ this.wavesBG.setPosition(cc.ccp(0, -12));
+ this.addChild(this.wavesBG);
+
+ this.boat = new Boat();
+ this.boat.setPosition(cc.ccp(0,0));
+ this.addChild(this.boat);
+
+ var upDownAction = cc.RepeatForever.create(
+ cc.Sequence.create(
+ cc.EaseOut.create(cc.MoveBy.create(.92, cc.ccp(0,10)),1.2),
+ cc.EaseOut.create(cc.MoveBy.create(.92, cc.ccp(0,-10)),1.2)
+ ));
+ this.boat.runAction(upDownAction);
+
+ this.waves = new Water();
+ this.waves.setPosition(cc.ccp(0, 0));
+ this.addChild(this.waves);
this.schedule(this.update);
return true;
-
},
update:function(dt){
- dpad.update();
- if(dpad.keys.up.state == dpad.stateKeyDown){
- console.log("Up Down!");
+
+ if(dpad.keys.left.state == dpad.stateKeyPressed){
+ this.boat.capn.setPosition(cc.ccp(this.boat.capn._position.x-1,this.boat.capn._position.y));
+ }else if(dpad.keys.right.state == dpad.stateKeyPressed){
+ this.boat.capn.setPosition(cc.ccp(this.boat.capn._position.x+1,this.boat.capn._position.y));
}
+
+ dpad.update();
}
});
View
19 Classes/PirateMutiny.js
@@ -1,2 +1,19 @@
-var PM = PM || {};
+var PM = PM || {};
+
+PM.PLAYER_STATE = {
+ WAITING:0,
+ WALK_LEFT:1,
+ WALK_RIGHT:2,
+ JUMP:3,
+ LOWER:4,
+ HIT:5,
+ DEAD:6
+}
+
+PM.GAME_SCENE = {
+ MENU:0,
+ GAME:1,
+ RESULTS:2,
+ HISCORE:3
+}
View
44 Classes/SpriteUtils.js
@@ -0,0 +1,44 @@
+var RepeatXSprite = cc.Node.extend({
+
+ build: function(refImageName, tileFunc){
+
+ var spriteRef = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(refImageName);
+
+ var tileW = spriteRef._rect.size.width;
+ var totalW = this._contentSize.width;
+ var count = Math.ceil(totalW/tileW);
+
+ for(var i = 0; i < count; i++){
+ var aTile = new tileFunc.spriteWithSpriteFrameName(refImageName);
+ aTile.setAnchorPoint(cc.ccp(0,0));
+ aTile.setPosition(cc.ccp(i*tileW,0));
+ this.addChild(aTile);
+ }
+
+ }
+
+});
+
+
+var setupSpriteAnimation = function(imageName, frames){
+
+ var animFrames = [];
+ var str = "";
+ for (var i = 1; i <= frames; i++) {
+ str = imageName + (i < 10 ? ("0" + i) : i) + ".png";
+ var frame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(str);
+ animFrames.push(frame);
+ }
+
+ var animation = cc.Animation.create(animFrames, 0.15);
+ cc.AnimationCache.sharedAnimationCache().addAnimation(animation, imageName);
+
+ // RUN ANIMATION
+ var animCache = cc.AnimationCache.sharedAnimationCache();
+ var idle_anm = animCache.animationByName(imageName);
+ var animN = cc.Animate.create(idle_anm);
+ var repeat = cc.RepeatForever.create(animN);
+ return repeat;
+
+};
+
View
144 Classes/World.js
@@ -0,0 +1,144 @@
+// BOAT
+
+var Boat = function(){
+
+ var node = new cc.Node();
+ var size = cc.Director.sharedDirector().getWinSize();
+
+ // BOAT
+ var boatFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName("boat01.png");
+ var boatSprite = new cc.Sprite();
+ boatSprite.initWithSpriteFrame(boatFrame);
+ boatSprite.setPosition(cc.ccp(0,0));
+ boatSprite.setAnchorPoint(cc.ccp(0, 0));
+ node.addChild(boatSprite);
+
+ // SAIL
+ var sail = new Sail();
+ sail.setAnchorPoint(cc.ccp(0, 1));
+ sail.setPosition(cc.ccp(0, size.height));
+ node.addChild(sail);
+
+ // CAPN
+ var capn = Capn.spriteWithSpriteFrameName("capn_idle01.png");
+ capn.setAnchorPoint(cc.ccp(0, 0));
+ capn.setPosition(cc.ccp(280, 202));
+ node.addChild(capn);
+
+ // PLANK
+ var plankFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName("plank01.png");
+ var plankSprite = new cc.Sprite();
+ plankSprite.initWithSpriteFrame(plankFrame);
+ plankSprite.setPosition(cc.ccp(-90,188));
+ plankSprite.setAnchorPoint(cc.ccp(0, 0));
+ node.addChild(plankSprite);
+
+
+ // REFERENCES
+ node.capn = capn;
+ node.sail = sail;
+ node.boat = boatSprite;
+
+ return node;
+}
+
+// SAIL
+var Sail = function(){
+ var pFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName("sail01.png");
+ var sprite = new SailSprite();
+ sprite.initWithSpriteFrame(pFrame);
+ return sprite;
+}
+
+SailSprite = cc.Sprite.extend({
+ init: function(){
+ this._super();
+ var animationAction = setupSpriteAnimation("sail", 4);
+ this.runAction(animationAction);
+ }
+});
+
+// SKY
+
+var Sky = function(){
+
+ var size = cc.Director.sharedDirector().getWinSize();
+
+ var sky = new RepeatXSprite();
+ sky.setContentSize(cc.SizeMake(size.width, 450));
+ sky.setAnchorPoint(cc.ccp(0, 0));
+ sky.build("background_sky.png", SkyTile);
+
+ return sky;
+}
+
+var SkyTile = cc.Sprite.extend({
+
+});
+
+SkyTile.spriteWithSpriteFrameName = function (spriteFrameName) {
+ var pFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(spriteFrameName);
+ var sprite = new SkyTile();
+ sprite.initWithSpriteFrame(pFrame);
+ return sprite;
+};
+
+
+// FOREGROUND WAVES
+
+var Water = function(){
+
+ var size = cc.Director.sharedDirector().getWinSize();
+
+ var waves = new RepeatXSprite();
+ waves.setContentSize(cc.SizeMake(size.width, 32));
+ waves.setAnchorPoint(cc.ccp(0, 0));
+ waves.build("waterwave01.png", WaterTile);
+
+ return waves;
+}
+
+var WaterTile = cc.Sprite.extend({
+ init: function(){
+ this._super();
+ var animationAction = setupSpriteAnimation("waterwave", 4);
+ this.runAction(animationAction);
+ }
+});
+
+WaterTile.spriteWithSpriteFrameName = function (spriteFrameName) {
+ var pFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(spriteFrameName);
+ var sprite = new WaterTile();
+ sprite.initWithSpriteFrame(pFrame);
+ return sprite;
+};
+
+
+// BACKGROUND WAVES
+
+var WaterBG = function(){
+
+ var size = cc.Director.sharedDirector().getWinSize();
+
+ var waves = new RepeatXSprite();
+ waves.setContentSize(cc.SizeMake(size.width, 68));
+ waves.setAnchorPoint(cc.ccp(0, 0));
+ waves.build("background_wave01.png", WaterTileBG);
+
+ return waves;
+}
+
+var WaterTileBG = cc.Sprite.extend({
+ init: function(){
+ this._super();
+ var animationAction = setupSpriteAnimation("background_wave", 6);
+ this.runAction(animationAction);
+ }
+});
+
+WaterTileBG.spriteWithSpriteFrameName = function (spriteFrameName) {
+ var pFrame = cc.SpriteFrameCache.sharedSpriteFrameCache().spriteFrameByName(spriteFrameName);
+ var sprite = new WaterTileBG();
+ sprite.initWithSpriteFrame(pFrame);
+ return sprite;
+};
View
566 Resources/pm.plist
@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>frames</key>
+ <dict>
+
+ <key>background_sky.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {16, 450}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{16, 450}</string>
+ <key>spriteSourceSize</key>
+ <string>{16, 450}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{54, 380}, {16, 450}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {52, 68}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{52, 68}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{952, 80}, {52, 68}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave02.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 2}, {52, 66}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -1}</string>
+ <key>spriteSize</key>
+ <string>{52, 66}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{0, 380}, {52, 66}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave03.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 4}, {52, 64}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -2}</string>
+ <key>spriteSize</key>
+ <string>{52, 64}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{704, 212}, {52, 64}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave04.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 6}, {52, 62}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -3}</string>
+ <key>spriteSize</key>
+ <string>{52, 62}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{952, 250}, {52, 62}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave05.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 4}, {52, 64}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -2}</string>
+ <key>spriteSize</key>
+ <string>{52, 64}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{952, 184}, {52, 64}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>background_wave06.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 2}, {52, 66}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -1}</string>
+ <key>spriteSize</key>
+ <string>{52, 66}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 68}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{704, 144}, {52, 66}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>boat01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {104, 332}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{104, 332}</string>
+ <key>spriteSourceSize</key>
+ <string>{104, 332}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{598, 46}, {104, 332}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>capn_idle01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {60, 96}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{60, 96}</string>
+ <key>spriteSourceSize</key>
+ <string>{60, 96}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{828, 46}, {60, 96}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>capn_idle02.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 2}, {60, 94}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{60, 96}</string>
+ <key>spriteSourceSize</key>
+ <string>{60, 96}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{704, 46}, {60, 96}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>capn_idle03.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 2}, {60, 94}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{60, 96}</string>
+ <key>spriteSourceSize</key>
+ <string>{60, 96}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{890, 46}, {60, 96}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>capn_idle04.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 4}, {60, 92}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{60, 96}</string>
+ <key>spriteSourceSize</key>
+ <string>{60, 96}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{766, 46}, {60, 96}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>cloud01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {166, 44}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{166, 44}</string>
+ <key>spriteSourceSize</key>
+ <string>{166, 44}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{780, 0}, {166, 44}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>cloud02.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {192, 42}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{192, 42}</string>
+ <key>spriteSourceSize</key>
+ <string>{192, 42}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{586, 0}, {192, 42}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>cloud03.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {132, 40}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{132, 40}</string>
+ <key>spriteSourceSize</key>
+ <string>{132, 40}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{0, 46}, {132, 40}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>plank01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {584, 14}}</string>
+ <key>spriteOffset</key>
+ <string>{0, -0}</string>
+ <key>spriteSize</key>
+ <string>{584, 14}</string>
+ <key>spriteSourceSize</key>
+ <string>{584, 14}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{0, 0}, {584, 14}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>sail01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {122, 188}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 3}</string>
+ <key>spriteSize</key>
+ <string>{122, 188}</string>
+ <key>spriteSourceSize</key>
+ <string>{122, 194}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{134, 46}, {122, 188}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>sail02.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {114, 188}}</string>
+ <key>spriteOffset</key>
+ <string>{-4, 3}</string>
+ <key>spriteSize</key>
+ <string>{114, 188}</string>
+ <key>spriteSourceSize</key>
+ <string>{122, 194}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{258, 46}, {114, 188}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>sail03.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {110, 194}}</string>
+ <key>spriteOffset</key>
+ <string>{-6, -0}</string>
+ <key>spriteSize</key>
+ <string>{110, 194}</string>
+ <key>spriteSourceSize</key>
+ <string>{122, 194}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{374, 46}, {110, 194}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>sail04.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {110, 194}}</string>
+ <key>spriteOffset</key>
+ <string>{-6, -0}</string>
+ <key>spriteSize</key>
+ <string>{110, 194}</string>
+ <key>spriteSourceSize</key>
+ <string>{122, 194}</string>
+ <key>spriteTrimmed</key>
+ <true/>
+ <key>textureRect</key>
+ <string>{{486, 46}, {110, 194}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>waterwave01.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {52, 32}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{52, 32}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 32}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{952, 46}, {52, 32}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>waterwave02.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 2}, {52, 30}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{52, 32}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 32}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{952, 150}, {52, 32}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>waterwave03.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 4}, {52, 28}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{52, 32}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 32}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{952, 314}, {52, 32}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ <key>waterwave04.png</key>
+ <dict>
+ <key>aliases</key>
+ <array>
+
+ </array>
+ <key>spriteColorRect</key>
+ <string>{{0, 0}, {52, 32}}</string>
+ <key>spriteOffset</key>
+ <string>{0, 0}</string>
+ <key>spriteSize</key>
+ <string>{52, 32}</string>
+ <key>spriteSourceSize</key>
+ <string>{52, 32}</string>
+ <key>spriteTrimmed</key>
+ <false/>
+ <key>textureRect</key>
+ <string>{{948, 0}, {52, 32}}</string>
+ <key>textureRotated</key>
+ <false/>
+ </dict>
+
+ </dict>
+ <key>metadata</key>
+ <dict>
+ <key>version</key>
+ <string>1.5.1</string>
+ <key>format</key>
+ <integer>3</integer>
+ <key>size</key>
+ <string>{1024, 1024}</string>
+ <key>name</key>
+ <string>pm.zwd</string>
+ <key>premultipliedAlpha</key>
+ <false/>
+ <key>target</key>
+ <dict>
+ <key>name</key>
+ <string>default</string>
+ <key>textureFileName</key>
+ <string>default</string>
+ <key>textureFileExtension</key>
+ <string>.png</string>
+ <key>coordinatesFileName</key>
+ <string>default</string>
+ <key>coordinatesFileExtension</key>
+ <string>.plist</string>
+ <key>premultipliedAlpha</key>
+ <false/>
+ </dict>
+ </dict>
+</dict>
+</plist>
View
BIN Resources/pm.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
11 cocos2d.js
@@ -6,7 +6,6 @@ cc.COCOS2D_DEBUG = 2;
cc._DEBUG = 1;
cc._IS_RETINA_DISPLAY_SUPPORTED = 0;
-//html5 selector method
cc.$ = function (x) {
return document.querySelector(x);
};
@@ -25,19 +24,20 @@ cc.loadjs = function (filename) {
if (this.order + 1 < cc.loadQue.length) {
cc.$('head').appendChild(cc.loadQue[this.order + 1]);
- }
- else {
+ } else {
cc.setup("gameCanvas");
cc.AudioManager.sharedEngine().init("mp3");
cc.Loader.shareLoader().onloading = function () {
cc.LoaderScene.shareLoaderScene().draw();
};
+
cc.Loader.shareLoader().onload = function () {
cc.AppController.shareAppController().didFinishLaunchingWithOptions();
};
cc.Loader.shareLoader().preload([
- //{type:"image", src:"Resources/HelloWorld.png"}
+ {type:"plist", src:"Resources/pm.plist"},
+ {type:"image", src:"Resources/pm.png"}
]);
}
};
@@ -51,4 +51,7 @@ cc.loadjs('Lib/Cocos2d-html5-canvasmenu-min.js');
cc.loadjs('Classes/AppDelegate.js');
cc.loadjs('Classes/dpad.js');
cc.loadjs('Classes/GameScene.js');
+cc.loadjs('Classes/Capn.js');
+cc.loadjs('Classes/World.js');
+cc.loadjs('Classes/SpriteUtils.js');
cc.loadjs('Classes/PirateMutiny.js');
View
15 server.py
@@ -0,0 +1,15 @@
+import sys
+import BaseHTTPServer
+from SimpleHTTPServer import SimpleHTTPRequestHandler
+
+HandlerClass = SimpleHTTPRequestHandler
+ServerClass = BaseHTTPServer.HTTPServer
+server_address = ('10.0.1.7', 8000)
+
+HandlerClass.protocol_version = "HTTP/1.0"
+httpd = ServerClass(server_address, HandlerClass)
+sa = httpd.socket.getsockname()
+
+print "Running on ", sa[0], " port", sa[1]
+
+httpd.serve_forever()

0 comments on commit 1c50355

Please sign in to comment.
Something went wrong with that request. Please try again.