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 - ulpa

Pages: [1]
1
Graphics / Re: Sprite can move diagonally [C++]
« on: June 01, 2015, 09:39:20 am »
-snip-
Thank you, that solved my problem.
-snip-
I used this before, but I found a problem with that, if you move around the mouse while pressing for example "D" the sprite will move around faster because of the Event loop triggering more times when the mouse is moving, hence why I am using this way instead. Although your system seems more advanced, since I only used something simple. 

2
Graphics / Sprite can move diagonally [C++]
« on: May 29, 2015, 02:33:36 pm »
Hello! I've a problem where my sprite can move diagonally upwards and not and it cannot move diagonally downwards. I don't want it to be able to move diagonally at all. I had diagonal movement before with some if statement with
if (sf::Keyboard::isKeyPressed(sf::Keyboard::W) && sf::Keyboard::isKeyPressed(sf::Keyboard::D) //move sprite
for everything. But I scrapped that idea because it was moving faster diagonally. Anyways here's my source. I uploaded it to pastebin to make it easier to read.
Also how do i print the location of the sprite?
http://pastebin.com/xZVi6LWg

Thanks in advance!

Pages: [1]