Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Flappy-Bird Clone Attempt  (Read 7327 times)

0 Members and 1 Guest are viewing this topic.

Powereleven

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Flappy-Bird Clone Attempt
« Reply #15 on: January 31, 2018, 06:47:03 pm »
Did you do this? Or used SFML_STATIC like Zinidane said
(Screenshot attached)
« Last Edit: January 31, 2018, 08:38:46 pm by Powereleven »

Tigre Pablito

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Flappy-Bird Clone Attempt
« Reply #16 on: February 10, 2018, 11:50:40 pm »
I wasn't able to run the app, it's a mess for me to set up the CodeBlocks IDE, given that I'm a boy used to the simplicity of Visual Studio and SFML.Net. My listening (and talking) is not so good as my reading (and writting), that's why the tutorial video didn't help me much. But I would like to run the game. Could someone tell me where to READ the instructions to make that IDE work? Thanks

Powereleven

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Flappy-Bird Clone Attempt
« Reply #17 on: February 11, 2018, 02:40:52 am »
Since then I downloaded Visual Studio Community 2015 (for free, easy to find online) and I managed to set it up. Then I downloaded this sfml one: Visual C++ 14 (2015) - 32-bit on https://www.sfml-dev.org/download/sfml/2.4.2/, then do this on the project properties:
1) in C/C++ >> General (All Configurations) >> Additional Include Directories, copy and paste where your sfml include folder is, in my case, E:\SFML-2.4.2\include
2) then on Linker >> General >> Additional Library Directories, put your sfml lib folder, in my case E:\SFML-2.4.2\lib
3) then select Debug (save what you just did), go to Linker >> Input >> Additional Dependencies >> Edit  and copy and paste those  (1 in each line, or add ; between them if you use 1 line):
sfml-graphics-d.lib
sfml-audio-d.lib
sfml-network-d.lib
sfml-window-d.lib
sfml-system-d.lib
4) then select Release (save what you just did), go to Linker >> Input >> Additional Dependencies >> Edit
and copy and paste those (1 in each line, or add ; between them  if you use 1 line):
sfml-graphics.lib
sfml-audio.lib
sfml-network.lib
sfml-window.lib
sfml-system.lib

Now to link dynamically,
5) Go to where you downloaded SFML and copy everything inside the bin folder (all the dlls files) and paste them inside your project debug folder. Let me explain this: if your project is called NAME, inside your folder NAME you have a Debug folder and another NAME folder (that's standard, you can change that if you want). Paste them inside the Debug folder. (You can paste them inside the NAME folder, but I don't suggest that, because that way you will have to compile and run it every time, instead of just using the .exe file located inside the Debug folder.)
6) Test if it works with the code given in SFML tutorials. (Please tell me if it works).
« Last Edit: February 11, 2018, 02:43:51 am by Powereleven »

Tigre Pablito

  • Full Member
  • ***
  • Posts: 219
    • View Profile
    • Email
Re: Flappy-Bird Clone Attempt
« Reply #18 on: February 12, 2018, 01:28:28 am »
Hi! Thank you very much for the explanation! (and for moving to a very simpler IDE)

Now I was able to do everything correctly and to run the game.  :D

Though it's a bit simple, it's very good. (My highest score was 6) And well done. (I suppose, though I'm not a C++ programmer, because I ran the game with no runtime errors, and because I looked at the code)

A few items I would suggest to improve:
* First of all, to tidy up the code (i.e. the target of an if statement goes beneath, and one statement per line). This is good for others who read the code, and for you to keep tidy and enlarge the game.
* Maybe it's better to pass the app object to the Bird and Obstacles objects when you create them, as you pass the Bird object to the Obstacles ones, so then the call to first.draw(); and so would be tidier.
* To use more functions (and maybe classes, and files) instead of writting all inside the main function. This also helps for readability and maintaining and enlarging the game.

Something that has nothing to do with programming itself, you could add keyboard input. And that the bird's flap is milder. I felt like that when I released the mouse button the hang was greater and greater. I´m not sure, but it may be a conceptual issue in the movement() and leftClick() functions.

Having said that, thanks again for your help in the set up. And congrats for the game. It's very good for a begginer.  :)