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

Pages: [1]
1
SFML projects / Re: Let's make 16 classic game in C++ video series
« on: May 27, 2019, 02:29:12 pm »
I think you have a problem with the libraries (i'm new to sfml). So check if you created the project with static or dynamic libraries and check if you have the libraries in the correct order (sml-graphics , sfml-window, sfml-system, sfml-audio) in the project build options -> linker settings.

2
SFML projects / Re: Starting sfml with two little games
« on: May 16, 2019, 08:58:34 pm »
Thanks , it helps. I did a little program and it works.

Code: [Select]
#include <iostream>
#include <random>

std::default_random_engine random_engine;
std::uniform_int_distribution<> coin(0,1);
int flip_coin(){return coin(random_engine);}

int main()
{
    random_engine.seed(27);
    for(int i=0;i<100;i++)
        std::cout << flip_coin() << " ";
    std::cout << std::endl;

    random_engine.seed(52);
    for(int i=0;i<100;i++)
        std::cout << flip_coin() << " ";
    std::cout << std::endl;

}

3
SFML projects / Re: Starting sfml with two little games
« on: May 14, 2019, 09:58:33 pm »
I have a lot of bad practices. Always forget to pass things by reference (i don't like pointers and references  ::) ). I've been trying the random number generators but couldn't make it to work. I'll study it more.

I may use Kairos in the future, when I have better knowledge of sfml, to make the code clearer.

Changed > for >= too. I will restructure the asteroids on thrusday.

4
SFML projects / Re: Starting sfml with two little games
« on: May 12, 2019, 10:17:54 pm »
I changed a lot of things, the time things are still confusing but i made it work. Now it can be splitted in some files easily. Entity class needs some changes. No state manager for now. And i clear the window always.

https://github.com/RafaelRodMar/SpaceShooter/blob/master/main.cpp

5
SFML projects / Re: Starting sfml with two little games
« on: May 10, 2019, 04:54:19 pm »
Thanks Hapax  :D

So, splitting, no global variables, event loop only once per frame and states. I have work for the weekend.

I use the background image instead of the windows.clear() thing. And the space shooter is mostly a copy of the asteroids one.

6
SFML projects / Starting sfml with two little games
« on: May 09, 2019, 07:58:48 pm »
Hi friends , i'm new to sfml and i want to program some little 2d games, so i took the Asteroids code from the 16 sfml games youtube videos and developed it a bit. The result is in the link (Asteroids and spaceshooter).

https://github.com/RafaelRodMar

What i want to know is if all is ok before doing another. I don't know if i am doing the time handling correctly because i don't multiply speed by delta time.

It seems to work but i need someone with knowledge to tell me if something is wrong.

Pages: [1]
anything