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

Pages: 1 ... 23 24 [25] 26 27
361
Window / Re: Window freezes with threads
« on: March 19, 2013, 11:38:21 pm »
The standard font is removed in the lastest version of SFML, so you have to load a font by your own and set it for each text object


AlexAUT

362
General / Re: Calculating direction
« on: March 19, 2013, 10:44:34 pm »
There you will need some maths  ;)

I think this site will solve your problem : http://www.wikihow.com/Find-the-Angle-Between-Two-Vectors

In your case the first vecotor is the vector between the origin and the mouseposition and the second is the x-axis.


Some more informations:

the cos-1 = std::acos(); -> acos needs rad and not deg.

How to convert deg to rad : http://www.teacherschoice.com.au/maths_library/angles/angles.htm

363
General / Re: Issues with codeblocks and sfml 2.0 (link/static lib)
« on: March 19, 2013, 09:15:08 pm »
Wich version of Codeblocks do you use? Because I had the exact same bug a few weeks ago...

If you use the newest 12.11 you have to recompile SFML by your own or download the right nightly build from exploid3r (
Nightly Builds: http://sfml.my-gate.net/nightly/)


AlexAUT

364
General / Re: Link error .exe
« on: March 19, 2013, 07:18:26 pm »
Everyone has to begin with small steps. Keep on working and stay focused and everything will turn right  ;)

365
General / Re: Link error .exe
« on: March 19, 2013, 06:54:10 pm »
No its not necessary.

Normal gameloop: check for Events -> DoLogic -> Clear the window -> Draw some stuff -> Display


while(window.isOpen() && running)
{
    //Check events
    //DoLogic
    //Rendering
}

 


AlexAUT

366
General / Re: Link error .exe
« on: March 19, 2013, 06:33:17 pm »
Maybe you should have a look again at the tutorial for SFML Windows http://www.sfml-dev.org/tutorials/2.0/window-window.php


You have to create the window: window.create(...), before you can use it.


AlexAUT

367
Graphics / Re: geting pixel
« on: March 19, 2013, 06:03:57 pm »
By the way, since I oftenly use different parts of the image I, in the while loop, declate new texture and set the part of the image for displaying to it with loadFromImage. But is there a way to do that only if player moved?


Make a function wich creates the needed textures for the current view, save the textures in a container/array so they wont get deleted after the frame.
And then only call the function if the player moves (maybe in or after the event-queue or in the logic part)


If you do it this way dont forget to clear the container before you call the function


AlexAUT

368
General / Re: How to handle multiple event for multi player ?
« on: March 19, 2013, 05:51:10 pm »
Ok i think i got your Problem  :)

Make 2functions, one for each player with a return value

enum Movement
{
   left,
   right,
   up,
   down
};

// Functions prototypes
Movement EventPlayer1(sf::Event& event);
Movement EventPlayer2(sf::Event& event);

// Game loop
   //...
   while(window.pollEvent(e))
   {
       // Close,resize,lostfocus....

       movementP1 = EventPlayer1(event);
       movementP2 = EventPlayer2(event);
   }
//


Movement EventPlayer1(sf::Event& event)
{
   // if left is pressed: return left ...
}
Movement EventPlayer2(sf::Event& event)
{
   // if Q is pressed: return left...
}

 

This way you have 2vars wich hold the current movement...


AlexAUT

369
General / Re: Run program outside of Code::Blocks
« on: March 19, 2013, 01:29:04 pm »
Maybe the tutorial for SFML2 under linux will help you http://www.sfml-dev.org/tutorials/2.0/start-linux.php

Especially this :
Quote
If SFML is not installed in a standard path, you need to tell the library loader where to find the SFML libraries first:

export LD_LIBRARY_PATH=<sfml-install-path>/lib && ./sfml-app

370
General / Re: How to handle multiple event for multi player ?
« on: March 19, 2013, 12:27:51 pm »
I´m not sure what´s your problem but i try to help you  8)

*Do you want that the play can walk left and up and the same time?
Then make 2variables one for the x-axis (left/right) and one for the y-axis(up/down) and change the if´s:

if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Left)
        movementX = LEFT; // movementX for the x-axis
else if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Right)
        movementX = RIGHT;

else if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Up)
        movementY = UP; // movementX for the y-axis
else if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Down)
        movementY = DOWN;

//The same for the second player
//So the Problem in your second code is also fixed...

 

Btw please use the codetag (its in the second line right a dropdown menu


AlexAUT

371
But with Kroniax\ 0.5.2 I get the following issue:

"couldn't find the level data"

maybe you could try to load the data in the same way than you did in the previous version.

As exp mentioned I didnt´t change anything depending the loading of files. Next week i will upload a Linux version (Source with a build-system).

About Kroniax 22d7e3a0b90a2b51cffaf388ee5e6160 I like it a lot, but the difficulty is too high.

Why is it too high? The problem is i get to level9 without a misstake, because I tested all levels about 20times. And I only got feedback about the difficulty from my classmates and they managed to get until lvl 7-9.

So what is the exact problem? Is the skillgap between 2levels too high? Should I create more easy levels?



Well Kroniax is still in heavy development and thus the levels aren't that balanced. The newer version reduce the difficulity a bit, but I only barely made it past level 4 and haven't beaten level 5 yet. ;)

Hmm, i was afraid that i made the "new" levels too easy  :-[ . So the "Share system" will be delayed but i will work hard on the balance of the levels.
But i will need some more feedback from you or maybe I will ask my female classmates ;). When you are too lazy to write you can send me a PN and I will send you my Skypename or my teamspeakserveraddress to speak about this topic

Btw there's some text issue, when starting Kroniax the first time:

Noticed!


AlexAUT

372
A released a new hotfix 0.5.2!

Patchnotes:

*Now you can see your Speed in the speed challenge mode!
*The game will pause if the window loses focus or the keys "P, alt or home" are pressed
*Fixed some collision bugs in several levels.
*Fixed the graphics bug with the dialogscreens


Have fun with it!


AlexAUT

373
SFML projects / Re: Kroniax - A game of skill, 0.4 released
« on: March 16, 2013, 10:09:51 am »
New version 0.5 released!

New features:

* New font, due to copyright =)
* Some bugfixes

* Added the Speedchallenge mode!
   *You have to unlock the levels in arcade mode, before you can play them in the speed challenge mode!
   *You can control your speed with the left and right arrowkeys.
   *At the end you can upload your time and you can compare it with others.
   *The top10 times of every map are saved
   *Anti-cheat-guard implemented on the server

Have fun and try to beat my times (AlexAUT)  =)


New version 0.5.1 released!

New features:

*Fixes a bug wich causes the server to crash... so i deleted the version 0.5!


Directlink (0.5.1) : http://www23.zippyshare.com/v/92029376/file.html

Link to a config file wich unlocks 5Levels: http://www12.zippyshare.com/v/75799792/file.html

374
Network / Re: How to stop the Selector example
« on: March 11, 2013, 11:15:52 pm »
Thanks for your answer,
yes first the whole code was in the function, the list and all the other things, now i changed it so i can terminate the thread and clear the list in a shutdown function.

I dont want to open another thread so i ask here, i read that the maximum of sent packets per second is 30. Is this per socket? What is the bottleneck for this limitation? CPU, Networkcard, Bandwidth, OS?

375
Network / How to stop the Selector example
« on: March 11, 2013, 09:00:32 pm »
Hy,
i´m currently working on a server/client application. To detect new clients i use nearly the same function as in the documentation is used

http://www.sfml-dev.org/documentation/2.0/classsf_1_1SocketSelector.php#details

This function is called by a thread, now my problem is that I dont know exactly how to stop the server, because the function will never stop.

* Can i use the terminate function? Will it call the deconsturctor of the sf::TcpSockets in the list?

* Or should i set "running = false" and create a pseudo client who connects to stop the thread?

and another question,  in this example "std::list<sf::TcpSocket*>" i have to delete the allocated memory by my own, or?


Pages: 1 ... 23 24 [25] 26 27
anything