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.

Topics - Dreken

Pages: [1]
General / Disabling the delay on holding down a key (HELP)
« on: September 11, 2012, 11:54:59 pm »
I'm using SFML 2.0-rc, Windows 7, Visual Studio 2010.

Here's my snippet of code:

if (sf::Keyboard::isKeyPressed(sf::Keyboard::W))
new_ypos = old_ypos - movespeed;

This sits inside the
while (window.pollEvent(event))

So, basically when I hold W, my character moves forward for a second, pauses for about 1 second, then W holds down. I know this is the delay in the operating system. The same thing happens when you hold a key on a text document.

Is there any way to get rid of this so that I don't have to wait for that 1 second delay before the character moves continuously, without changing the OS settings? I know where the OS option is, but I don't want to do this if I want to send the game to other people.

So does SFML have anything, or C++?

Graphics / Adding collision rectangles to tiles (Help)
« on: September 09, 2012, 08:27:12 pm »
I'm using sfml 2.0-rc, Windows 7, and Visual studio 2010.

Here is my snippet of code:

for(int nrow = 0; nrow < 24; nrow++)
                        for (int ncol = 0; ncol < 33; ncol++)
                        sprite2.setPosition(ncol * 32, nrow * 32);
                        sprite1.setPosition(ncol * 32, nrow * 32);
                        if (dDungeon[nrow][ncol] == '#')

                                CollisionRectangles[nrow][ncol] = sf::FloatRect (ncol*32, nrow*32,32,32);
                        if (dDungeon[nrow][ncol] == ' ')

I'm getting some kind of error when I hover over the sf::FloatRect, which reads:

"Error: No suitable Conversion function from "sf::FloatRect" to "float" exists.

I don't really understand this at all, can anyone help?

With this code, I'm creating a tilemap from sprites, and putting one collision rectangle over every single sprite so that I can define collision detection later with a moving character sprite.

So how do I load 792 different (24*33) collision rectangles into an array made to store them?

General / Help with Tile Based Animations
« on: September 08, 2012, 08:15:15 am »
I'm using SFML 2.0-rc, windows 7, and visual studio 2010.

My character is on a tile map. When I hit 'W', he goes up, but obviously he goes from the bottom tile to the top instantly with no animation.

Does anyone have any suggestions for animating his climb from the bottom tile to the top that doesn't interrupt the game being real time?

My tile map uses a char array, so I can't figure it out because I can't set values inbetween numbers (ie. 1, 1.2, 1.3, ect..) I can only do 1, 2, 3 which is jumpy.

Window / Help, Printing an Array to Window is causing unusual Display
« on: September 07, 2012, 09:14:34 pm »
I need help desperately, I am on Windows 7, using SFML 2.0-RC, and visual studio 2010.

Here is the snippet of code:


And here what is being outputted (attachment).

Why is there a space of nothing, and then suddenly the first row?

Why is the first row being printed after everything and the null pointer? Why is it starting at the index point "1" in the array instead of "0" like it should? (As in it starts at 1, gets to the null pointer, then goes back to 0.)

Thanks for your help.

Pages: [1]