How to Make a Game Like Jetpack Joyride using LevelHelper, SpriteHelper [Cocos2D 2.X edition] - Part 4
22 posts
• Page 1 of 3 • 1, 2, 3
How to Make a Game Like Jetpack Joyride using LevelHelper, SpriteHelper [Cocos2D 2.X edition] - Part 4
This is the official thread to discuss the following blog post: How to Make a Game Like Jetpack Joyride using LevelHelper, SpriteHelper [Cocos2D 2.X edition] - Part 4
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ray Wenderlich
Blog: http://www.raywenderlich.com
Twitter: http://twitter.com/rwenderlich
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

rwenderlich - Site Admin
- Posts: 1780
- Joined: Thu Dec 23, 2010 4:14 pm
- Has thanked: 26 times
- Been thanked: 189 times
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
Cool!! Just a typo: In the final part of the tutorial, when you say: "In Part Two, " or In Part Three, they link you to the old parts , not to the upgraded ones 
Also some advice to the readers, if you have enemies with animations, don't use AutoTraced Shapes, just use circle shape (if not, you're gonna get low fps), circle shapes just work great
Also some advice to the readers, if you have enemies with animations, don't use AutoTraced Shapes, just use circle shape (if not, you're gonna get low fps), circle shapes just work great
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
Yes, circle shapes are the fastest ones - but you can also optimise the shape you auto trace with the optimise slider inside SpriteHelper.
- vladubogdan
- Uber Haxx0r
- Posts: 131
- Joined: Wed Aug 24, 2011 6:05 am
- Has thanked: 0 time
- Been thanked: 12 times
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
HI Vladu, thanks for updating the tutorial.
I just obtained copies of sprite helper and level helper but I like to ask as a novice to level helper about the following gray areas:
1. How do I move objects using the accelerometer in level helper?
2. How to spawn objects randomly using level helper?
3. Is it possible to use openGl code in level helper for fluid simulation?
4. is it possible to mix cocos2d code and level helper "loader" codes in the same project?
Thanks in advance for your reply.
I just obtained copies of sprite helper and level helper but I like to ask as a novice to level helper about the following gray areas:
1. How do I move objects using the accelerometer in level helper?
2. How to spawn objects randomly using level helper?
3. Is it possible to use openGl code in level helper for fluid simulation?
4. is it possible to mix cocos2d code and level helper "loader" codes in the same project?
Thanks in advance for your reply.
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
Hey,
Yes, you can do all this things.
1. you will do it the same as you currently do it. (LHSprite is a subclass of CCSprite). The important thing to know is that the LHSprite is attached to a b2Body object (if it has physics) so in this case the transformations (position, rotation) are handled by Box2d and not cocos2d.
LHSprite code can help you move both so instead of using setPosition or setRotation (cocos2d methods) you will use
transformPosition, transformRotation, transformScale (LHSprite specific methods)
For transformations cocos2d actions (like move to point) you should enable overloaded transformations - e.g just do this
[sprite setUsesOverloadedTransformation:YES];
2. Check out Documentation tab(inside LH app) -> LevelHelper API -> cocos2d -> LevelHelperLoader class -> Create sprites dynamically.
3. Yes, just write your code in the draw method - the same as you will normally do it
4. yes.
LH code is just a bunch of classes that helps you do what you need but they dont restrict you in any way.
Yes, you can do all this things.
1. you will do it the same as you currently do it. (LHSprite is a subclass of CCSprite). The important thing to know is that the LHSprite is attached to a b2Body object (if it has physics) so in this case the transformations (position, rotation) are handled by Box2d and not cocos2d.
LHSprite code can help you move both so instead of using setPosition or setRotation (cocos2d methods) you will use
transformPosition, transformRotation, transformScale (LHSprite specific methods)
For transformations cocos2d actions (like move to point) you should enable overloaded transformations - e.g just do this
[sprite setUsesOverloadedTransformation:YES];
2. Check out Documentation tab(inside LH app) -> LevelHelper API -> cocos2d -> LevelHelperLoader class -> Create sprites dynamically.
3. Yes, just write your code in the draw method - the same as you will normally do it
4. yes.
LH code is just a bunch of classes that helps you do what you need but they dont restrict you in any way.
- vladubogdan
- Uber Haxx0r
- Posts: 131
- Joined: Wed Aug 24, 2011 6:05 am
- Has thanked: 0 time
- Been thanked: 12 times
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
Thanks man for the fast answers to my queries...you are indeed a star!
For me its LevelHelper all the way ...!!
For me its LevelHelper all the way ...!!
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
@vladubogdan: I am here once again, I have tried implementing moving an object using accelerometer in level helper but I am at cross roads now. My problem is in your reply you talked about me using LHSprite methods transformScale etc....
Now I have been searching for where these classes are so that I can understand how they are used and I have not been able to locate any docs on that. I have looked at LH API but there isn't anything on that. Secondly please can you help with just writing a LH code snippet that I can use to move an object using the accelerometer from the left to the right and vice versa of the iphone screen while keeping the object within the screen boundaries.
Thanks
vladubogdan wrote:Hey,
Yes, you can do all this things.
1. you will do it the same as you currently do it. (LHSprite is a subclass of CCSprite). The important thing to know is that the LHSprite is attached to a b2Body object (if it has physics) so in this case the transformations (position, rotation) are handled by Box2d and not cocos2d.
LHSprite code can help you move both so instead of using setPosition or setRotation (cocos2d methods) you will use
transformPosition, transformRotation, transformScale (LHSprite specific methods)
For transformations cocos2d actions (like move to point) you should enable overloaded transformations - e.g just do this
[sprite setUsesOverloadedTransformation:YES];
Now I have been searching for where these classes are so that I can understand how they are used and I have not been able to locate any docs on that. I have looked at LH API but there isn't anything on that. Secondly please can you help with just writing a LH code snippet that I can use to move an object using the accelerometer from the left to the right and vice versa of the iphone screen while keeping the object within the screen boundaries.
Thanks
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
CCPoint pos = [sprite position];
pos.x *= accelerometer
[sprite transformPosition:pos];
Check x and y of the pos and sprite width and height in order to be inside the screen.
LHSprite.h its the place to look and "LHSprite class" chapter inside LevelHelper API from under "Documentation" tab inside LevelHelper.
pos.x *= accelerometer
[sprite transformPosition:pos];
Check x and y of the pos and sprite width and height in order to be inside the screen.
LHSprite.h its the place to look and "LHSprite class" chapter inside LevelHelper API from under "Documentation" tab inside LevelHelper.
- vladubogdan
- Uber Haxx0r
- Posts: 131
- Joined: Wed Aug 24, 2011 6:05 am
- Has thanked: 0 time
- Been thanked: 12 times
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
im having a problem with level-helper when i download the project and run it in the simulator the game is not set to retina display and everything in the game is offset..the game is unplayable ..how do i fix it?
EDIT: forget i just decided to rebuild the map again from scratch...it works great now.
EDIT: forget i just decided to rebuild the map again from scratch...it works great now.
- Coder2012
- n00b
- Posts: 3
- Joined: Thu Feb 14, 2013 2:26 pm
- Has thanked: 0 time
- Been thanked: 0 time
Re: How to Make a Game Like Jetpack Joyride using LevelHelpe
When i try Running the game on my device everything functions great but the only things visible are the player and the bunnies?!?!?!?!?!?!WTF?!?!

- Coder2012
- n00b
- Posts: 3
- Joined: Thu Feb 14, 2013 2:26 pm
- Has thanked: 0 time
- Been thanked: 0 time
22 posts
• Page 1 of 3 • 1, 2, 3
Who is online
Users browsing this forum: No registered users and 8 guests