Permalink
Browse files

Day 2 results

  • Loading branch information...
1 parent 63bfa66 commit 170cfe6f2d865ba4ee8f91d6a5053048187effd7 Sergej Tatarincev committed Aug 26, 2012
View
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>frames</key>
+ <dict>
+ <key>bat_die0.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,2},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ <key>bat_die1.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{44,2},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ <key>bat_die2.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{86,2},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ <key>bat_stay0.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{44,44},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ <key>bat_stay1.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,44},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ <key>bat_stay_0.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{44,44},{40,40}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,40}}</string>
+ <key>sourceSize</key>
+ <string>{40,40}</string>
+ </dict>
+ </dict>
+ <key>metadata</key>
+ <dict>
+ <key>format</key>
+ <integer>2</integer>
+ <key>realTextureFileName</key>
+ <string>bat.png</string>
+ <key>size</key>
+ <string>{128,86}</string>
+ <key>smartupdate</key>
+ <string>$TexturePacker:SmartUpdate:356db2b77ca1ce63ca11b2448d969ae7$</string>
+ <key>textureFileName</key>
+ <string>bat.png</string>
+ </dict>
+ </dict>
+</plist>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -16,18 +16,22 @@
</tileset>
<layer name="beach_background" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC+3NN1YCUABEUdarFAYMyA6UYEAU3IEBBTHvwJzjDsyKmYZb2/7Cwv/Ouc00k0jEYrFYLPb3ddBJ8tfeRTc99JKij34GGCTNEJmA/2FGyJIjT4FRxhhngiKTlJhimjIVZgL+Z5ljngWqLLJEjTrLNFhhlTXW2WCTrYD/bXbYZY99DjjkiGNOOOWMcy645IprbgL+b7njngceeeKZF15p8sY7H3zyxTc/tAL+Y7H/VBtVEYoCAAwAAA==
+ H4sIAAAAAAAAA+3NN1YCUABEUdarFAYMyA6UYEAU3IEBBTHvwJzjDsyKmYZb2/7Cwv/Ouc00k0jEYrFYLPb3ddBJ8tfeRTc99JKij34GGCTNEJmA/2FGyJIjT4FRxhhngiKTlJhimjIVZgL+Z5ljngWqLLJEjTrLNFhhlTXW2WCTrYD/bXbYZY99DjjkiGNOOOWMcy645IprbgL+b7njngceeeKZF15p8sY7H3zyxTc/tAL+Y7H/VBtVEYoCAAwAAA==
</data>
</layer>
<layer name="cave_background" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC2NgGAWjYBSMglEwCgYeMAIxExAzU0CzUGA/KwV6YYCDAr2cVLCfZwjbzwvEfEDMTwKNzhagwP5RMApGEgAAxWzvCwAMAAA=
+ H4sIAAAAAAAAA2NgGAWjYBSMglEwCgYeMAIxExAzU0CzUGA/KwV6YYCDAr2cVLCfZwjbzwvEfEDMTwKNzhagwP5RMApGEgAAxWzvCwAMAAA=
</data>
</layer>
<layer name="walls" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC2NgoC6QJ1KdKpXtRbZfBIjVoFh0AOwnBozaTzoQBGJJAliFhvYT67dR+zEBep6E2U8oPsmJW2IArdL/SLafmHKXlvaTAoay/aSEMy3spwYYtX/UfhAQphKWI9N+agFS60Za2I9cLhAqG2D2AwBXZ5EAAAwAAA==
+ H4sIAAAAAAAAA2NgoC6QJ1KdKpXtRbZfBIjVoFh0AOwnBozaTzoQBGJJAliFhvYT67dR+zEBep6E2U8oPsmJW2IArdL/SLafmHKXlvaTAoay/aSEMy3spwYYtX/UfhAQphKWI9N+agFS60Za2I9cLhAqG2D2AwBXZ5EAAAwAAA==
</data>
</layer>
- <objectgroup name="objects" width="32" height="24"/>
+ <objectgroup name="objects" width="32" height="24">
+ <object name="Bat1" type="Bat" x="274" y="122" width="47" height="172"/>
+ <object name="Bat2" type="Bat" x="393" y="406" width="202" height="43"/>
+ <object name="Snake1" type="Snake" x="5" y="378" width="370" height="42"/>
+ </objectgroup>
</map>
View
2 resources/cave01.tmx 100755 → 100644
@@ -16,7 +16,7 @@
</tileset>
<layer name="walls" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC2NgoA6QJ1G9KpXsHS72CwKxJAVYhUL7SXU/pYCe9osAsRoSFqWz/djAqP2j9o/aj1p+oedT9DyLC+DTh8ssZai9o2AUDDUAS+/48sQoIA4IDzAeaAAAsqwgEQAMAAA=
+ H4sIAAAAAAAAC2NgoA6QJ1G9KpXsHS72CwKxJAVYhUL7SXU/qUAEiNWgWHQA7EcHo/YPb/vR0xu97ScERu2HAOTyCznO0DG2OIQBfPpwmaUMtXcUjIKhBmDpHV+eGAXEAeEBxgMNAC9AWLwADAAA
</data>
</layer>
<objectgroup name="objects" width="32" height="24">
View
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="32" height="24" tilewidth="20" tileheight="20">
<properties>
+ <property name="background" value="SKY"/>
<property name="rightPortal" value="resources/level1.tmx"/>
</properties>
<tileset firstgid="1" name="beach_bg" tilewidth="20" tileheight="20">
@@ -11,20 +12,20 @@
</tileset>
<layer name="background" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC+3PRWwVYRQG0HnF3dvi7i1W966xBU7QNe5ua9zd1rgGgm9xd3d3dw5JVyQkb9HlfMnJPzP55t6ZIAgTJkyYMGHCFEZiI0EQR3ykcOcmmJf4n5lJnieTQipppJNBJllkk0MueeRH+X3t9TrQkU50/ue9Lu670o3u9KAnvehd0O3j7Es/+jOAgVHuH6Q3mCEMZRjDGcFIRjGaMYxlHOOZwEQmMZkpTGUa05kR5f6ZerOYzRzmMo/5LGAhi1jMEpayjOWsYCWrWM0a1rKO9VHu36C3kU1sZgtb2cZ2drCTXewumLnHubfgep9zPwc4yCEOcySK/Ud1jnGcE5zkFKc5w1nOcZ4LXOQSl7nCVa5xnRvc5Ba3ucNd7nGfBzzkEY95wlOe8ZwXvOQVr3nDW97xng985BOf+cJXvvGdH/zkF7///ntMEESIoQhFKUZxSlCSUpSmDGUpR3kqUJFKVKYKValGLHHEU50a1KQWtalDXepRnwY0pBGNaUJTmtGcFrQkgURa0Zo2tKUdSSSTQipppJNBJllkk0MueeTzB4dcE98ADAAA
+ H4sIAAAAAAAAA+3PRWwVYRQG0HnF3dvi7i1W966xBU7QNe5ua9zd1rgGgm9xd3d3dw5JVyQkb9HlfMnJPzP55t6ZIAgTJkyYMGHCFEZiI0EQR3ykcOcmmJf4n5lJnieTQipppJNBJllkk0MueeRH+X3t9TrQkU50/ue9Lu670o3u9KAnvehd0O3j7Es/+jOAgVHuH6Q3mCEMZRjDGcFIRjGaMYxlHOOZwEQmMZkpTGUa05kR5f6ZerOYzRzmMo/5LGAhi1jMEpayjOWsYCWrWM0a1rKO9VHu36C3kU1sZgtb2cZ2drCTXewumLnHubfgep9zPwc4yCEOcySK/Ud1jnGcE5zkFKc5w1nOcZ4LXOQSl7nCVa5xnRvc5Ba3ucNd7nGfBzzkEY95wlOe8ZwXvOQVr3nDW97xng985BOf+cJXvvGdH/zkF7///ntMEESIoQhFKUZxSlCSUpSmDGUpR3kqUJFKVKYKValGLHHEU50a1KQWtalDXepRnwY0pBGNaUJTmtGcFrQkgURa0Zo2tKUdSSSTQipppJNBJllkk0MueeTzB4dcE98ADAAA
</data>
</layer>
<layer name="walls" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC+3Otw2AQBQE0Q8htAL914Tn8B6mhAtAItiRXrbBmimllFJKKfWfssAsR4ESFWo0aOHQoceAERNmLFixYceBExduWOj3IWIXe26/LOFD+vKPB/ta7xsADAAA
+ H4sIAAAAAAAAA+3Otw2AQBQE0Q8htAL914Tn8B6mhAtAItiRXrbBmimllFJKKfWfssAsR4ESFWo0aOHQoceAERNmLFixYceBExduWOj3IWIXe26/LOFD+vKPB/ta7xsADAAA
</data>
</layer>
<objectgroup name="objects" width="32" height="24">
<object name="Spawn" x="190" y="312" width="80" height="80"/>
</objectgroup>
<layer name="foreground" width="32" height="24">
<data encoding="base64" compression="gzip">
- H4sIAAAAAAAAC+3TxUqFARSF0ct9OcXu7u7uxsbGBBNMMMF8PZcP4PSM/g1r/I12KpUsWbLoZaRTqcx0TCtLJ5sccskjn4KAfqFGEcWUUEoZ5VQE9Cs1qqimhlrqqKchoN+o0UQzLbTSRjsdAf1OjS666aGXPvoZCOgPagwxzAijjDHOREB/UmOKaWaYZY55FoL+t6izxDIrrLLGelB/Q2eTLbbZYZe9oP6+zgGHHHHMSVD7b6daZ5xzwSVXgf1rrRtuueOeh8D+o9YTz7zwyltg/13rg0+++OYnsJ/s//0CJVGG9AAMAAA=
+ H4sIAAAAAAAAA+3TxUqFARSF0ct9OcXu7u7uxsbGBBNMMMF8PZcP4PSM/g1r/I12KpUsWbLoZaRTqcx0TCtLJ5sccskjn4KAfqFGEcWUUEoZ5VQE9Cs1qqimhlrqqKchoN+o0UQzLbTSRjsdAf1OjS666aGXPvoZCOgPagwxzAijjDHOREB/UmOKaWaYZY55FoL+t6izxDIrrLLGelB/Q2eTLbbZYZe9oP6+zgGHHHHMSVD7b6daZ5xzwSVXgf1rrRtuueOeh8D+o9YTz7zwyltg/13rg0+++OYnsJ/s//0CJVGG9AAMAAA=
</data>
</layer>
</map>
View
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.0" orientation="orthogonal" width="48" height="24" tilewidth="20" tileheight="20">
<properties>
+ <property name="background" value="SKY"/>
<property name="leftPortal" value="resources/level0.tmx"/>
<property name="rightPortal" value="resources/cave00.tmx"/>
</properties>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+ <dict>
+ <key>frames</key>
+ <dict>
+ <key>spider_die0.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,24},{40,20}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,20}}</string>
+ <key>sourceSize</key>
+ <string>{40,20}</string>
+ </dict>
+ <key>spider_die1.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,2},{40,20}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,20}}</string>
+ <key>sourceSize</key>
+ <string>{40,20}</string>
+ </dict>
+ <key>spider_die2.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,24},{40,20}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,20}}</string>
+ <key>sourceSize</key>
+ <string>{40,20}</string>
+ </dict>
+ <key>spider_stay0.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,46},{40,20}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,20}}</string>
+ <key>sourceSize</key>
+ <string>{40,20}</string>
+ </dict>
+ <key>spider_stay1.png</key>
+ <dict>
+ <key>frame</key>
+ <string>{{2,68},{40,20}}</string>
+ <key>offset</key>
+ <string>{0,0}</string>
+ <key>rotated</key>
+ <false/>
+ <key>sourceColorRect</key>
+ <string>{{0,0},{40,20}}</string>
+ <key>sourceSize</key>
+ <string>{40,20}</string>
+ </dict>
+ </dict>
+ <key>metadata</key>
+ <dict>
+ <key>format</key>
+ <integer>2</integer>
+ <key>realTextureFileName</key>
+ <string>spider.png</string>
+ <key>size</key>
+ <string>{44,90}</string>
+ <key>smartupdate</key>
+ <string>$TexturePacker:SmartUpdate:85fb865be71d37835e437dfa907389c3$</string>
+ <key>textureFileName</key>
+ <string>spider.png</string>
+ </dict>
+ </dict>
+</plist>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -14,6 +14,8 @@ require(['cocos2d', 'scenes/GameScene'], function(cc, GameScene) {
applicationDidFinishLaunching: function() {
cc.SpriteFrameCache.sharedSpriteFrameCache().addSpriteFramesWithFile('resources/Darwin.plist');
cc.SpriteFrameCache.sharedSpriteFrameCache().addSpriteFramesWithFile('resources/snake.plist');
+ cc.SpriteFrameCache.sharedSpriteFrameCache().addSpriteFramesWithFile('resources/bat.plist');
+ cc.SpriteFrameCache.sharedSpriteFrameCache().addSpriteFramesWithFile('resources/spider.plist');
var director = cc.Director.sharedDirector();
director.setDisplayFPS(true);
View
@@ -0,0 +1,74 @@
+define(['cocos2d', 'actors/Enemy'], function (cc, Enemy) {
+ 'use strict';
+ var SPEED = 150;
+ var Bat = Enemy.extend({
+ initWithMapObject:function (mapObject) {
+ var frameCache = cc.SpriteFrameCache.sharedSpriteFrameCache();
+ this.initWithSpriteFrame(frameCache.spriteFrameByName('bat_stay0.png'));
+ this.loadMapObject(mapObject);
+ return true;
+ },
+
+ createIdleAnimation:function () {
+ var frameCache = cc.SpriteFrameCache.sharedSpriteFrameCache();
+ return cc.Animation.create([
+ frameCache.spriteFrameByName('bat_stay0.png'),
+ frameCache.spriteFrameByName('bat_stay1.png')
+ ], 0.3);
+
+ },
+
+ createDieAnimation:function () {
+ var frameCache = cc.SpriteFrameCache.sharedSpriteFrameCache();
+ return cc.Animation.create([
+ frameCache.spriteFrameByName('bat_die0.png'),
+ frameCache.spriteFrameByName('bat_die1.png'),
+ frameCache.spriteFrameByName('bat_die2.png')
+ ], 0.1);
+ },
+
+ beginMoving:function (mapObject) {
+ if (mapObject.width > mapObject.height) {
+ this.moveHorizontaly(mapObject);
+ } else {
+ this.moveVerticaly(mapObject);
+ }
+ },
+
+ moveHorizontaly:function (mapObject) {
+
+ var duration = mapObject.width / SPEED;
+
+ var run = cc.Sequence.create(
+ cc.MoveBy.create(duration, cc.ccp(-mapObject.width, 0)),
+ cc.MoveBy.create(duration, cc.ccp(mapObject.width, 0))
+ );
+
+ this.runAction(cc.RepeatForever.create(run));
+
+ },
+
+ moveVerticaly:function (mapObject) {
+
+ var duration = mapObject.height / SPEED;
+
+ var run = cc.Sequence.create(
+ cc.MoveBy.create(duration, cc.ccp(0, mapObject.height)),
+ cc.MoveBy.create(duration, cc.ccp(0, -mapObject.height))
+ );
+
+ this.runAction(cc.RepeatForever.create(run));
+
+ }
+ });
+
+ Bat.create = function (mapObject) {
+ var node = new Bat();
+ if (node && node.initWithMapObject(mapObject)) {
+ return node;
+ }
+ throw new Error('Unable to initialize object');
+
+ };
+ return Bat;
+});
View
@@ -1,6 +1,6 @@
define(['cocos2d'], function (cc) {
'use strict';
- /** @const */ var GRAVITY = -160;
+ /** @const */ var GRAVITY = -360;
/** @const */ var X_ACCELL = 1000;
/** @const */ var ANIMATION_TAG = 1;
/** @const */ var HIT_DISTANCE = 58;
@@ -128,7 +128,7 @@ define(['cocos2d'], function (cc) {
jump:function () {
if (this.onGround) {
- this.velocity.y = 220;
+ this.velocity.y = 330;
this.onGround = false;
this.stopAnimation();
if (!this.attacking) {
Oops, something went wrong.

0 comments on commit 170cfe6

Please sign in to comment.