Home › Forums › General Discussion › Paralaxer: New 2d game.
Tagged: 2d, Box2D, ladders, paralaxer
| Author | Posts |
|---|---|
| Author | Posts |
| July 8, 2012 at 1:47 am #2566 | |
| stmaddox | Has anyone else downloaded the new 2d kit? It seems to work pretty well. I have not looked into Box2d so I need to study that and C++ a little. I tried for fun changing the tile map to one I had already made but it worked weird. It was probably that my tiles were 64 x 64 pixels which I don’t think works well with Box2d. |
| July 10, 2012 at 1:46 am #2572 | |
| stmaddox | Nat, I substituted my art for a Player into Paralaxer and noticed that the setStandingFrame has Jump instead of Standing. When my player was standing still he was in a Jump frame. Also, when he quits walking, he doesn’t stand still but uses a walk frame. Haven’t found how to fix this yet. |
| July 12, 2012 at 12:36 am #2583 | |
| Nat Weiss | Yep, the artwork for the character in Paralaxer is a little different, so that’s why your character profile isn’t translating over perfectly. Check out Player.cpp and all the places where it calls “spriteFrameForKey” and also “animate” and modify as necessary. Regarding ladders, this will definitely be something I cover in the Cocos2d-X Book in the Ladders, Water, Speech chapter. Though here’s a quick overview: 1. Make an object that represents the ladder. Get some graphics for it and size it correctly in the level. |
| July 12, 2012 at 9:39 pm #2594 | |
| stmaddox | I didn’t notice the ladders topic on the book you are writing. I will slow down and wait until you post your chapters before I ask questions. Thanks. |
| July 15, 2012 at 12:13 am #2606 | |
| stmaddox | I guess there is no current direction for the player so if I have him stand I can’t make sure he is facing the same direction he was walking? I think I can add a variable to keep track of direction in walk part of update. |
| July 16, 2012 at 7:46 pm #2611 | |
| Nat Weiss | You can keep track of the direction by testing if the player has his sprite flipXed. In the player’s code, you can do something like this: if( this->sprite->isFlipX() ) |
| July 18, 2012 at 9:24 pm #2619 | |
| stmaddox | I changed all the fixes I put in back to original but kept my art. I then changed the jump rotation to zero and I figured out what was confusing me. If you have walked then the jump works. If you jump in the opposite direction of last jump without moving then you jump backwards. I will try the above code you gave me in the touch or jump area. Just an idea for book if there is a place for it, doing sloped ground to slide down etc. I haven’t checked out the tile map part yet but I suspect that in box2d that for each tile it uses a square as the body. The other day I died over a barrel and my dead body kept bouncing up and down. I thought that was really funny. |
| July 19, 2012 at 1:06 am #2620 | |
| stmaddox | Okay I added a line this->sprite->setFlipX( jumpXVelocity < 0.0f ); in the touch method in jump area and everything works great. |
| July 19, 2012 at 2:20 am #2623 | |
| Nat Weiss | Nice! By the way, here’s a great article on slopes: |
You must be logged in to reply to this topic.
