Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - iv-med

Pages: [1]
1
General / Re: Questions about vehicle movement
« on: June 01, 2015, 11:13:36 am »
The idea is not that you copy the code 1:1 and complain if it doesn't immediately work as expected. It should rather serve as a source of inspiration... As eXpl0it3r said, as a programmer you have to be able to come up with your own solutions.

If you struggle with implementing vehicle movement, maybe you should start with something simpler until you have the necessary experience? :)
Yes, you right.

2
General / Re: Questions about vehicle movement
« on: June 01, 2015, 10:47:59 am »
Does this help:
                if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
                {
                        if (movementVec == forwardVec)
                        {
                                currentSpeed -= deceleration * dt;
                                if (currentSpeed < 0.f)
                                        movementVec = reverseVec;
                        }
                        else
                        {
                                currentSpeed += acceleration * dt;
                                if (currentSpeed > maxSpeed)
                                        currentSpeed = maxSpeed;
                        }
                }

 8)


EDIT: Fixed typo

Hi!
You code is incorrect
When I press down my car moves forward :(

3
General / Questions about vehicle movement
« on: May 26, 2015, 07:02:45 pm »
Hi to all!
I'm planning to create simple racing game, but there have been some difficulties associated with the movement of the vehicle:
1)how to make a front-wheel drive vehicle using SFML?
2)how to make a smooth braking car when you press the "down"?

I have attached the source code in an attachment.
I would be grateful for any help!

Pages: [1]
anything