Tag Info

New answers tagged

0

Like you said, the card is just a thin line when centered on the screen in the x-axis at 90 degrees, at any other position (including the above case) the card will be a thin line when it aligns with the normal from the camera to the card's centre. Using the dot product between two angles you can figure out the angle between them, so from the cameras ...


0

Your solution, thus-far, implies you are already calculating depth to determine the scale factor needed to simulate perspective. To make objects move "behind" the camera, test that same depth when you draw them and do not draw objects whose depth indicates they should be behind the camera. if (object.sceneDepth >= 0) object.Draw(); Re: (like ...


0

Adding to the print out suggestion and changing it to a >= comparator to detect the problem given by Demetry, you should also investigate what's causing the current if statement to fail. My guess would be that you've actually incremented the score variable more than once before you ever even reach the if statement within the given game loop. Make sure that ...


0

When in doubt PRINT OUT! ;) cout << "THIS WORKED" << endl; Use print in your if statement to see if your score is being hit. If not I suggest printing the score to see what it is at when you think its 2 or if its being displayed and you know for sure its 2 try if(score >= 2){ //See if that changes anything. ! :) } If you use the ...


1

For one body, you can use Kepler's laws to create an elliptical equation paramaterized by time. For two or more bodies, you're out of luck in terms of a nice closed-form solution. See the N-body problem. However, you can still solve this problem numerically. Instead of doing what you're doing now (which is called Euler Integration), you can instead use a ...


0

Here is another method, using a little bit more complex lambda: First some setup, like initial movement speed and time between speed increases: float speed = 0; float delay = 1; Here's the tricky part! I'm using CallFuncN since I want to run a new action (with new speed) every delay seconds. So I need to know to which Node I should attack new MoveBy ...


0

I'm not sure if this code work but what you need can be accomplished easily with a Scheduler as this: Schedule( [&](float dt) { speed+= 0.3; if(speed==N) Unschedule("TimerID"); } , 1, "TimerID");


1

Follow these steps: Create an action with a callback to your function: CallFunc *runCallback = CallFunc::create(CC_CALLBACK_0(Youclass::theFunc, this)); Create a delay With Delaytime class: // for 1 second auto delay = DelayTime::create(1); Create a sequence with the delay and your runCallback function in the part of the code that you need to sleep it. ...


0

Although problem still exist in windows, But in Android everything magically is shown correctly independent of using English / Persian in any order. I test it with Label::createWithSystemFont ! PS: I guess Label understanding the direction(LtR or RtL) by checking first letter maybe. I will test it and edit this answer soon.



Top 50 recent answers are included