I am new to LevelHelper.
I have created a Car+2 wheels using Wheel Joint(The same as the one in Wheel Joint of LevelHelper youtube tutorial).
My question is how can I programmatically add multiple Car with all the wheel and physics???
Should I add separate Sprite and Add my joints and then bind them???
Help is much appreciated
Regards;
I Was in the same sittuation as you are now. I have created track and my bike object in separate level and created separate levelhelperloader object for track and bike and add it to the b2world.
This is worked for me. I hope it will work for you also.
Related
I want to set up a scoreboard for these two players (Pikachu)
My questions are:
how to detect when the ball touches the ground?
how to setup an object that can change during the game?
like the two in this picture:
I'm very new to SFML and Box2D, so even if I try to read the source code to see what I can use to implement things above, I still have no idea.
Can anyone give me some clues?
To create a scoreboard similar to the one in the image provided you can put text on the screen that holds the current score of the players and then placing it in the position where you want the score to be placed on the screen. In SFML this would be done by creating a sf::Text object.
To answer your other questions.
1.how to detect when the ball touches the ground
A simple way of doing this would be to check the Y value of the coordinates of the ball and from that determining if the ball is touching the ground.
2.how to setup an object that it can change during the game.
I am unsure what you mean by this.
I am starter in cocos2d-x.I have multiple sprites of arms legs eyes etc.i want to create a single sprite ,suppose a human out of it who has arms,legs,eyes,head,body etc.How to do it..As i have to animate them and make the human walking and also i have to kill it on touch.Any one here please tell me the logic in cocos2d-x using c++
CocosBuilder can be used for assembling the body parts. By laying down each sprite to its own layer, you can also animate them, create different animations for walking, dying.
Tutorials :
http://www.raywenderlich.com/23996/introduction-to-cocosbuilder
http://www.plungeinteractive.com/blog/2012/10/29/using-cocosbuilder-on-cocos2d-x-games/
There is another way of using it.We can use cocostudio also and export the file as JSON
Refer to this link
http://upyun.cocimg.com/CocoStudio/helpdoc/v1.0.0.0/en/index.html
I have currently built my sprites in SpriteHelper and levels in LevelHelper. I have included most of my sprites in the Level but i want to also add some separately in the code. This is so i can spawn at different rates and times based on the users progress and collections of other objects.
Can someone help me or point me in the right direction on how to include a sprite from SpriteHelper (with physics) into my code. Do i need to generate the SpriteHelper code and include it in, even though i have already included the LevelHelper generated code?
Thanks
you can create lhsprite using levelehelperloader object manually at run time. see the link below http://www.gamedevhelper.com/documentation/documentation.html#top
In levelhelper documentation search for createsprite you will get enough information to create new sprite.
I'm having major issues trying to resize/scale/reshape a b2body's fixture... I've read so many tutorials and since I'm a n3wb at box2d most of it doesn't make sense.
What I'm trying to do exactly is make the collision box of a b2body scale to a CCSprite in cocos2d as the sprite moves dynamically through the application.
Any reference code would be greatly appreciated, I know you have to destroy and recreate the fixture but I have no idea how to do it correctly! I've been at this for hours now with no success. Thanks!
I think you need to create new fixture with new body. Please check out tutorial, it solve another problem, but you will learn many useful things (e.g. how to recreate body with new fixture):
http://www.raywenderlich.com/14302/how-to-make-a-game-like-fruit-ninja-with-box2d-and-cocos2d-part-1
http://www.raywenderlich.com/14393/how-to-make-a-game-like-fruit-ninja-with-box2d-and-cocos2d-part-2
Hi. I am new on this website and also in cocos2d. I am a student and I need your help.
I am making a game based on one of the tutorials in a cocos2d game development book. The concept is simple; different objects are falling from the top of the screen and I have to avoid or catch them by tilting the device. The main character, which is one which has to avoid objects, has different properties which can change by grabbing different objects (e.g. the player may have a shield if it grabs one). In order to display the shield I have to change the sprite of the player. I am not sure how I can achieve this. Could anyone help me in providing some guidelines on this?
Use setTexture to switch the image (texture) of your current sprite with another:
[playerSprite setTexture:[[CCTextureCache sharedTextureCache] addImage:#"playerWithShield.png"]];