### 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 - Finn

Pages: [1]
1
##### General / Setting Sprite on a circle around the player in an angle to mouseposition
« on: September 29, 2012, 04:51:57 pm »
Hey there!
Got a pretty much mathematical problem here I couldn't figure out after hours of trying...maybe some1 can help me.

Let me explain...

So I want to set the object's position to a coord on the circle.
The circle's coord should be calculated using the angle between the player and the mouse-position.

Hope you know what I'm talking about.

Greets,
Finn

2
##### General / Handling FileInput?
« on: December 01, 2010, 08:17:06 pm »
Anyone's got an idea how I could manage to open a filescreen where you can choose a file? Like almost every software has...something like an "Open"-thing. Hope you know what I mean

3
##### General / Better way of enemy-list
« on: October 05, 2010, 08:44:11 pm »
Hey!
I have some problems with my enemylist. All enemys are saved in a std::vector. So...I can't change them on the fly. I have to do:
Code: [Select]
`std::vector<enemy>::iterator It;enemy Enemy;for(It = List.begin(), int i = 0; i < List.size(); i++, It++){    Enemy = List.at(i);    List.erase(It);    //change things like position and stuff...       List.push_back(It);}`

But this produces some lag for the enemys. So it seems!
What's a better way of doin' this?
thx,
Finn

4
##### General / A * help!
« on: October 01, 2010, 07:09:05 pm »
Hey.
I try to implement path-finding for my game. Inspired of some threads here I'd like to try the A* - Pathfinding! I read a few articles about it but I don't really get it. Could someone show me some source? I don't really how to implement the algorithm with c++!
thx,
Finn

5
##### Window / How to use the ConvertCoords() function proberly
« on: September 28, 2010, 05:48:17 pm »
I'm trying to do some dynamic drawing. Means: Everything that is on a position you can't see at the moment won't be displayed. For this purpose I'd like to ask, how to use the ConvertCoords() function. Without views I'd do:
Code: [Select]
`bool DynamicWindow::IsInSight(const sf::Drawable &Drawable){ int X = Drawable.GetPosition().x; int Y = Drawable.GetPosition().y; if(X < 0 || X >= m_Width || Y < 0 || Y >= m_Height)//check if the Drawable can be seen return false; else return true;}`
where m_Width and m_Height the size of the displayed window is. But this doesn'T work with views! Help please

6
##### General / Using the Collision-Detection
« on: August 27, 2010, 02:42:32 pm »
Hi
I'm using this collision-class http://www.sfml-dev.org/wiki/en/sources/simple_collision_detection !
It works perfect!
But now I try to figure out how to use this in the way, that my character can't walk through an other sprite...
I tried something like this:
Code: [Select]
`const sf::Input& Input = window.GetInput();/float ResetValue = 1.0f;float XPos = Player.Sprite.GetPosition().x;//Position of the player spritefloat YPos = Player.Sprite.GetPosition().y;if(Input.IsKeyDown(sf::Key::Right)    if(test.PixelPerfectTest(Player.Sprite,TestBox))//Testbox is a sprite        Player.Sprite.SetPosition(XPos-ResetValue,YPos);    else        Player.Sprite.SetPosition(XPos+Player.Speed,YPos);`

But this is ugly. If the player is colliding it shakes back and forward. Also It seems this is a little bit buggy.
Is there a better way to do this?
Greets,
Finn

7
##### SFML projects / Sketch RPG
« on: August 26, 2010, 02:14:42 pm »
Hi everyone.
I'd like to introduce the project I'm working on!
It's a Role Play Game made by using C++ & SFML...
Wonder why it's called "Sketch"? Well, because of the graphics. All the graphics are/will be made by drawing and scanning them. The only editing is done using GIMP to get the right size of Images!

The game is in a very early state because I'm working on my own. And this is what I'm looking for:
A 2D artist for the graphics
Requirements:
- Good to very good skills in drawing comic-style
- A scanner to scan the images
- Time for the project

Thats you? Contact me: fhax@gmx.de, or visit the site: http://finnhax.co.cc/(under construction)

If the I finish the project I'll think about making some money with it and of course the 2D-Artist(s) will be awarded 1:1 for his/their work!

So far,
Finn

8
##### Graphics / Mapscrolling with static interface
« on: August 24, 2010, 09:05:01 pm »
Hey
I wanted to know if there's a way to use a sf::View with just a few elements on the screen.
The thing is that I have a interface which should not be moved. But my interface is a little bit on the map as you can see here:

Suggestions?
Greets,
Finn

9
##### General / Life-/Mana-bar
« on: August 21, 2010, 09:47:45 pm »
Hey!
I'm working on a RPG now want to implement a graphical life-/mana-bar.
This is what the Interface looks like: http://image-upload.de/image/UnSVI3/ae07c5f534.png

I want the 2 bars to be filled red(life)/blue(mana) by the amount of % life/mana. For example the bar should be filled half if life is 50%.
Don't know how to do so.
I thought of just putting a red/blue square behind each bar and set it's position lower, if life/mana gets lower. But you would see the 2 squares...

Any other suggestions?
greets,
Finn

10
##### Graphics / Change mousecursor
« on: August 17, 2010, 08:00:47 pm »
Hey
I wondered if there's a way to have a custom mousecursor! Just a Sprite on the mouse's position won't do it

11
##### Window / Clear the Input
« on: August 08, 2010, 09:45:56 pm »
Hey
I'm working on a rpg at the moment. Now I want to know how to clear the Input. For example:
I want to level up the character by pressing 'F1'.
If I do it like:
Code: [Select]
`if((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::F1)){ Player.levelup();        //...}`

it's like 30 level ups by pressing 'f1'....any suggestions?
thanxs,
Finn

12
##### Network / Get messages from the server
« on: September 21, 2009, 09:15:13 pm »
I was wondering how to get messages with the client from the server?! If the client connected once, it should be able to send messages from the server to the client on this connection, shouldn't it? If so, how to do it?
greets Finn

13
##### Network / Packet problem
« on: September 16, 2009, 07:02:43 am »
Is this code correct? Don't know whats wrong...
Code: [Select]
`//Server#include <SFML/Network.hpp>#include <iostream>using namespace std;int main(){    while(1)//Holding the server open for new connection    {        sf::SocketTCP Listener;        if(!Listener.Listen(2304))        {        cout << "Unable to listen to the given Port 2304!" << endl;        }        sf::SocketTCP Client;        sf::IPAddress ClientAddress;        if(Listener.Accept(Client, &ClientAddress) != sf::Socket::Done)        {        cout << "Some error occured.Clients are unable to connect to the Server" << endl;        }        sf::Packet Packet;        std::string Order;        while(1)        {            if(Client.Receive(Packet) == sf::Socket::Disconnected)        {            cout << "The client disconnected" << endl;            break;            }        Client.Receive(Packet);        Packet >> Order;        cout << ClientAddress << ": " << Order << endl;        if(Order == "Server.Close"){break;}        }        if(Order == "Server.Close"){Listener.Close();Client.Close();}        //Else: Restart Server    }   } //Client#include <SFML/Network.hpp>#include <iostream>using namespace std;int main(){    sf::SocketTCP Client;    if(Client.Connect(2304,"192.168.178.22") != sf::Socket::Done)    {    cout << "Unable to connect to the server!" << endl;    }       std::string Order;    sf::Packet Packet;    while(1)    {    cout << ">> ";    cin >> Order;    Packet << Order;    Client.Send(Packet);    if(Order == "Client.Close"){break;}    }    Client.Close();} `

The first Packet send isn' displayed at the server...if I send a second Package, the first is displayed at the server and after any packet I send isn't displayed
Hope you can help!

Pages: [1]
anything