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

Pages: [1] 2
1
Window / g++ Build problem
« on: June 16, 2010, 04:49:05 pm »
Just so you know, all other modules (sfml-graphics, sfml-audio, etc.) all depend on sfml-system, so you should always link to it when using SFML.

2
Window / g++ Build problem
« on: June 16, 2010, 02:43:34 am »
You also need to link to sfml-system.

3
General / I can't get SFML 2 to build on Fedora 12.
« on: May 10, 2010, 04:06:02 am »
The shared object files are copied to /usr/local/lib when you make install when they really should be in /usr/lib.  Just copy all of the libsfml-*.so.2.0 to your /usr/lib directory.

4
General / Taking the time control approach - questions
« on: April 11, 2010, 06:00:55 pm »
The FRAMERATE variable shouldn't matter.  That's the nice thing about this, it locks the frame rate to whatever you desire.  Can we see your new code?

5
Graphics / [Solved]Why does this not work (Sprite SetImage problem)
« on: April 11, 2010, 05:59:01 pm »
You'll either want to pass the image to the player by reference, or with a pointer.

Try changing your player code to:
Code: [Select]

Player(Image& i);

void assign(Image& i);

6
General / Taking the time control approach - questions
« on: April 11, 2010, 05:52:32 pm »
I also had this problem myself with the inconsistent step size.  Gsaurus' approach was the best I found, and it works well.

7
General / Static Library Linking
« on: April 01, 2010, 10:11:45 pm »
I'm trying to create a Static Library (.a) based on SFML with Code::Blocks.  I've created a simple library to test, but even that isn't working.

Here is the code of the library:
Code: [Select]

// File Test.h
#ifndef TEST_H
#define TEST_H

class Test
{
    public:
        Test( );
        void Function( );
};

#endif

// File Test.cpp
#include <iostream>
#include <SFML/System.hpp>
#include "Test.h"

Test::Test( )
{
    std::cout << "Test::Test( ) " << sf::Randomizer::Random( 0, 10 ) << std::endl;
}

void Test::Function( )
{
    std::cout << "Test::Function( ) " << sf::Randomizer::Random( 50, 100 ) << std::endl;
}


I then add libsfml-system-s.a into the library using ar.
Code: [Select]

ar x libsfml-system-s.a
ar rs libStaticSFMLTest.a *.o

I'm pretty sure it works, since the file size of the library increases, after adding SFML System.

When I try to compile a project using the new library, I get linker errors:
Code: [Select]

C:\Documents and Settings\Eternal Warrior\My Documents\CodeBlocksProjects\StaticSFMLTest\libStaticSFMLTest.a(Test.o):Test.cpp:(.text+0x2f)||undefined reference to `sf::Randomizer::Random(int, int)'|


I'm sure I'm doing something wrong, but I can't figure out what.  Any help is appreciated.

8
General / Delta Time and Jumping
« on: March 28, 2010, 08:45:00 pm »
I think I understand now.  Thank you for the link.  That makes more sense.

9
General / Delta Time and Jumping
« on: March 28, 2010, 05:34:49 am »
Hello.  I'm currently working on a platform game, and I'm using Delta timing for synchronization.  The problem is that my computer is rather slow, and lags often so every time a lag spike occurs, the player jumps higher than normal (Delta time compensation).  Is there any way I can prevent this, or is it just an inherent flaw of using Delta time?  Thanks.

Edit: Here's my code for reference

Main game loop:
Code: [Select]

player.Input( window.GetInput( ) );

deltaTime = window.GetFrameTime( ) * 60.0f; // Synchronize to 60 FPS
player.Update( deltaTime );


Player definition:
Code: [Select]

void Player::Input( const sf::Input& input )
{
    if( input.IsKeyDown( sf::Key::W ) )
    {
        if( y >= 448.0f )
        {
            verticalSpeed = -6.0f;
        }
    }
}

void Player::Update( float deltaTime )
{
    y += verticalSpeed * deltaTime;

    if( y >= 448.0f )
    {
        verticalSpeed = 0.0f;
        y = 448.0f;
    }

    if( y < 448.0f ) verticalSpeed += 0.1f;

    sprite.SetPosition( x, y );
}

10
Window / Simple Noob error with the Windows Tutorial
« on: March 04, 2010, 11:08:13 pm »
Unless you renamed the files, you should be linking against "sfml-sytem-d.lib" and "sfml-graphics-d.lib".  There should be a hyphen ("-") in between instead.

11
Window / Simple Noob error with the Windows Tutorial
« on: February 27, 2010, 10:17:26 pm »
It appears you forgot the ".lib" at the end.  You should be linking against "sfml-system-d.lib" and "sfml-winodw-d.lib".

12
General / [C++] Help with classes
« on: January 15, 2010, 05:15:20 am »
Where did you put the "class Piece;"?

13
General / [C++] Help with classes
« on: January 15, 2010, 02:42:40 am »
What happens when you try to include "Piece.h" in your "Board.h" file, is that both files are trying to include each other at the same time.  This is called a circular dependency.  It's basically a chicken or the egg scenario.  To fix this, instead of including "Piece.h", add
Code: [Select]
class Piece;
at the top of your "Board.h".  This is called a forward declaration.  It tells the compiler that you have a class named Piece, but it doesn't actually need to know the contents of Piece in the header file.  Then include "Piece.h" wherever you have your implementation of Board's functions (probably "Board.cpp").

14
Network / Creating a server list for online games
« on: December 20, 2009, 03:09:17 am »
Your PHP page should look something like this:
Code: [Select]

<?php
 $server 
$_GET"server" &#93;;
 
$ip $_GET"ip" &#93;;
 
$port $_GET"port" &#93;;

 
add_server&#40; $server, $ip, $port &#41;;
?>



And then call "yourpage.php?server=servervar&ip=ipvar&port=portvar" using a sf::Http::Request (http://www.sfml-dev.org/tutorials/1.5/network-http.php).

15
Graphics / Load Font from Memory
« on: December 13, 2009, 08:41:05 pm »
Thank you for taking the time to post those improvements.

Pages: [1] 2