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

Pages: 1 ... 4 5 [6] 7 8 ... 10
76
General / SFML Complete Game Tutorial
« on: September 10, 2011, 03:38:02 pm »
This is nice! That was my problem too, SFML does not provide complete examples, rather snippets.

I think you should rather put this topic to 'Project Announcements'!

Keep it up! :D

77
Graphics / VSync does not work properly!
« on: September 10, 2011, 03:33:06 pm »
True, true and true.

By the way, this is how I check FPS:

Code: [Select]
   unsigned int FrameTime = Window.GetFrameTime();
    lastFPS = currentFPS;
    currentFPS = (unsigned int)(1000.f / float(FrameTime));
    if (currentFPS != lastFPS)
    {
        std::ostringstream oss;
        oss << "FPS: " << currentFPS;
        FPSText.SetString(sf::String(oss.str()));
    }
    drawText(Window, FPSText, sf::Vector2f(10, ws.y - 35), sf::Color::White);

78
Graphics / Text rendering problem
« on: September 10, 2011, 03:25:06 pm »
Quote from: "Kian"
I found the problem, you're using comic sans.


Heheh, no it's 'Cheeseburger', the basic font that came along with the pong example in SFML! :)

79
SFML projects / Pacaman [Demo]
« on: September 10, 2011, 03:15:19 pm »
Quote from: "Haikarainen"
Dude! You're one hell of a games designer, even if its something as simple as pac(a)man ;) Looks very nice, will try it out soon


Haha, thanks! :) By the way, you cannot try it out as I haven't shared it yet! :P

Demo will be available when the basic gameplay is done.

80
SFML projects / iCEĀ³ - clone of Minecraft
« on: September 10, 2011, 03:12:32 pm »
Cool! Thanks! I'm gonna try it later, because acually now I'm working... :D

81
SFML projects / Falling Rocks! (demo inside)
« on: September 10, 2011, 03:08:52 pm »
I couldn't play your game beacuse of it's so fast! I know I should just set it to use VSync, but come on, this not how it's intended to be!

What problems do you experience when using framerate independent movement and animation? I do the same, for all the thing that should change over time. I don't use clocks - at least not for important stuff - because then the game would not be synchronized well.

Here's some pseudo code for movement:

Code: [Select]
sf::Vector2Df position(sprite.GetPosition());
sf::Vector2Df shift;

float playerSpeed = 20;
float deltaTime = float(Window.GetFrameTime()) / 1000.f;

if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Left)) shift.x = -deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Right))shift.x =  deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Up))   shift.y = -deltaTime * playerSpeed;
if (sf::Keyboard::IsKeyPressed(sf::Keyboard::Down)) shift.y =  deltaTime * playerSpeed;

position += shift;

/* ... Do some collision and response which modifies position vector too ... */

sprite.SetPosition(position);



Here's some for animation:

Code: [Select]
[animationTimer, animationFrame, maxAnimationFrames are integers declared in your class outside this function]

int animationSpeed = 200; // 1/5 second

animationTimer += int(Window.GetFrameTime());
if (animationTimer > animationSpeed)
{
  animationTimer -= animationSpeed;
  ++animationFrame;
  /* With the two lines above actually you can go out of sync
     with your animation, but only if the FrameTime is too large.
     If it is, the game must be unplayable anyway, so I tend to
     ignore this possibility. */
  if (animationFrame > maxAnimationFrames) animationFrame = 0;
}

sprite.setAnimationFrame(animationFrame); // This is really pseudo!

82
Graphics / Text rendering problem
« on: September 10, 2011, 12:47:53 am »
Today I've tested it on Windows XP and Windows 7, and the same glitch is present, see the image above.

83
Graphics / VSync does not work properly!
« on: September 10, 2011, 12:46:03 am »
Today I've compiled my game on Windows, and found the following possible bug:

VSync produces 200 FPS on an ASUS laptop with integrated video card on WindowsXP, and 40-60 FPS on a desktop machine set to 85Hz on Windows 7 with ATI Radeon video card.

I'm talking about SFML2 here.

84
SFML projects / Pacaman [Demo]
« on: September 10, 2011, 12:39:43 am »
Quote from: "Kian"
That's a pretty cool, that they each have a 'personality'. :D


Yeah, and actually this is what you can make use: you can predict their movement after playing a couple of rounds! As I recall the ghosts in original Pacman game also had different personalities.

-----

Today I've managed to port the game to Windows! Yay! :D It was easier than I thought, so I've added Win32 debug and release build targets to the project file. I've also found some SFML related bugs, so I'm gonna go and report them right now.

85
Graphics / VSync does not work properly!
« on: September 08, 2011, 05:25:46 pm »
Quote from: "Haikarainen"
Hmm thats odd, what is your secret dude? Seems like everything you do works a little bit better than anything i attempt to do, regarding this thread and the tile-view thingy


Hehe, I guess nothing! I don't think our code is that different to mine as thePyro_13 has pointed out:

Quote from: "thePyro_13"
Shouldn't you have an "/ 1000" in there somewhere?


So basically I just divide "frame time" with 1000 to get the delta time. Ergo I don't know why you experience that choppy gameplay!

Are you sure that everything that can move/change over time is actually related to the "frame time" variable?

The way I do it, I practically don't use any clocks. Instead, I use Window.GetFrameTime everywhere to keep all the movements synchronized.

86
SFML projects / Galaxy
« on: September 08, 2011, 02:10:36 pm »
Don't worry, I've just made a Launcher script and it works! Testing... :D

87
SFML projects / Galaxy
« on: September 08, 2011, 02:06:35 pm »
Ok I've downloaded both of the files, and then I've realized it's an exe... :shock: I don't have WINE, but I have booted up a Windows in VirtualBox. I've installed the game there but it did not work. The window has frozen, actually. Anyway, I've copied these files on my Linux plus the Linux pack you've provided but it seems you've forgotten about the Launcher script, as I cannot find it anywhere. Running just the Galaxy executable does not do anything, just a window pops up and closes immediately.

88
Graphics / VSync does not work properly!
« on: September 08, 2011, 01:41:58 pm »
Exactly!

I use

Code: [Select]
   float deltaTime = float(FrameTime) / 1000.f;
    float moveScale = moveSpeed * deltaTime;
    /* ... */
    pos += moveVect * moveScale;
    /* ... */
    Sprite.SetPosition(pos);


Where

Code: [Select]
unsigned int FrameTime = Window.GetFrameTime();
float moveSpeed = an arbitary value
sf::Vector3f pos = Sprite.GetPosition();
sf::Vector3f moveVect = the direction of the entity as a vector

89
SFML projects / Pacaman [Demo]
« on: September 07, 2011, 11:38:31 pm »
Today I've bumped into a bunch of tourists when crossing the main square of my town, and I just realized they move exactly like the blue ghosts in my game: they wander around aimlessly...

So then I've renamed my blue ghost from Pacifist to Tourist! :D

Meet da team:



The Maniac is very red and very fast and likes to chase players.
The Stalker is purple and mean and slow and follows you almost everywhere, he's always in yor heels.
The Survivor is the green one he has a nasty weapon: two lives!
And the Tourist who's just likes to walk around...

90
SFML projects / Galaxy
« on: September 07, 2011, 11:23:09 pm »
I'm going to try it out as soon as it gets downloaded. 50 minutes left? Something must be wrong here... I'm going to try it again!

To download the other one from SFMLUploads were just a blink.

Pages: 1 ... 4 5 [6] 7 8 ... 10
anything