Tag Info

New answers tagged

1

Overview Essentially I think your talking about the problem where objects move to far in a single update step thus allowing them to seemingly pass through walls. This is a common problem, but an understandably irritating one for the player - although sometimes it's fun. Direct Solution The most direct way of answering your question I can think of is to ...


1

I think I can help you someway. In Cocos2dx we could handle collision event with EventListenerPhysicsContact. check out this code: auto character = Sprite::create("chacracter.png"); auto body = PhysicsBody::createCircle(sprite->getContentSize().width / 2); body->setContactTestBitmask(-1); body->getFirstShape()->setMass(200); ...


0

thank you for your answer. I've implemented the portal in my game. I use OverlapArea to check if there are objects near the portal and duplicate them to next portal. And if the objects leave the portal, I delete all objects that are not visible by the camera. You can see the effect here.


1

My solution would me to create 2 identical objects that are spaced apart by the width of the screen.So when the first object is in the middle of the view (for example left one), the other object would be screen width apart from the first object i.e. off the view. When you move the first object the second one moves along with that object, keeping the space ...


2

While the character is running, mark the surface that he's running on as the active running surface. As long as the speed does not reduce to 0 (or reduced, depending on your mechanics), you're on the same surface, no matter if the head touches another surface. To detect where you go next, if your surface is stored as a grid, store last grid cell that you ...


0

You can use the dot product of a world up vector with an up vector relative to the player. If both of these vectors are normalized, you're results will be between 1 and -1. With 2d vectors the dot product is calculated by taking the product of the x components and adding them to the product of the y components. Given the vectors A = (x,y) and B = (X,Y). ...


0

You could have two collision sensors: one just under the character's feet and one just over it's head. Then it would be a matter of checking the positions of both sensors when they are both triggered and if the foot sensor is higher than the head sensor then you know that the body is upside down.


0

If your room take up the whole game screen (a bit like your image), there not much you can do, because you do need to have part of that orange circle both on the left and on the right of the screen. If your world is large and you platformer center its view on the character, there's more hope. Let's say your world has a width of h. For example, split your ...



Top 50 recent answers are included