Part 5: The Play State - Make Video Games w/ LibGDX: Flappy Bird

Sdílet
Vložit
  • čas přidán 25. 06. 2024
  • Making Flappy Birds from start to finish using Java and the LibGDX Framework. The result being a game that runs on multi-platforms including: Android, iOS, Desktop, and Blackberry!
    Learn about game-loops, textures, orthographic cameras, and game worlds!
    Please feel free to ask questions, I am always willing to help when needed!
    If you are feeling generous please help by donating to my patreon page... This helps me spend more time producing content that I otherwise wouldn't be able to:
    / brentaureli
    source: github.com/BrentAureli/Flappy...
  • Věda a technologie

Komentáře • 94

  • @nikipiki390
    @nikipiki390 Před 8 lety +26

    Best explanations I've seen in a LibGdx tutorials.Nice work!

  • @chargeshoot
    @chargeshoot Před 8 lety

    you've explained every "core" methods of LibGDX very carefully, so easy to understand
    thank you so much!

  • @someonlinevideos
    @someonlinevideos Před 7 lety +1

    I've been immediately hooked on this series since making some time to finally watch it after seeing it on androiddev subreddit. I've already subscribed on the second video, but you've really attracted me as a great CZcamsr as you gracefully accepted a trivial (yet greatly appreciated) suggestion to meet Java conventions with your lower case package names. I know that's the smallest issue, but combined with your great explanations and perfectly portioned videos, you've really impressed me and I look forward to seeing more of your content! Thanks Brent!

  • @programinhas
    @programinhas Před 6 lety

    Best explanations I've seen in a LibGdx tutorials indeed!!!!

  • @rupantaradhikary1793
    @rupantaradhikary1793 Před 2 lety

    you structured the game realy well i love the way its uses java and opps concepts

  • @AhmedEssam-lv5vn
    @AhmedEssam-lv5vn Před 8 lety +1

    You are really good in game development!
    Thank you

  • @davidestabelli7806
    @davidestabelli7806 Před 9 lety

    Thanks for your lessons.
    I'm waiting for more videos!!

  • @NLogSpace
    @NLogSpace Před 9 lety +1

    Great videos, thank you very much!

  • @Lokir_Fink
    @Lokir_Fink Před 9 lety +4

    We need more tutorials!! We are hungry :Q__
    Thanks for all what you are doing here!

  • @aidas2485
    @aidas2485 Před 7 lety

    Nice tutorial, thanks.

  • @muhammedhuseyinkolbasi1632

    Thank you Brent :))))

  • @kirkbrown4352
    @kirkbrown4352 Před 6 lety

    you videos are the best

  • @RanTutorials
    @RanTutorials Před 9 lety +4

    Keep making videos like this and you will blow. honestly. Its inevitable. Well done.

    • @NahroGamer
      @NahroGamer Před 9 lety

      Random Tutorials yeah

    • @RanTutorials
      @RanTutorials Před 9 lety

      I added "Well done" so you could of guessed that in this context blow up meant good. But yeah I think if you continue with these type of videos and the production value you have you will grow a lot.

    • @royhonders
      @royhonders Před 8 lety

      +Brent Aureli Hahah. You're doing well indeed. Keep it up.

  • @ChaleFX
    @ChaleFX Před 6 lety

    excellent!

  • @w5Ax3zs2khASCgrp
    @w5Ax3zs2khASCgrp Před 8 lety +1

    winter is coming brent

  • @android_plus_plus
    @android_plus_plus Před 8 lety

    amazing

  • @emerhajg
    @emerhajg Před 8 lety

    +Brent Aureli first of all, thank you very much your tutorial series we love that sooo much!
    I have a quick question about camera zoom settings:
    Why do we need this?
    Do we need this only if our units needs some zoom, or there are some other reasons too?
    If I leave this settings, is my game will works the same way like I set up this?
    (Aside from the units width's and height's seems like the half of the original images on the display.)

    • @emerhajg
      @emerhajg Před 8 lety

      +Brent Aureli
      I did not have the exact wording, I meant this line settings parameters:
      camera.setToOrtho(false, WindowScreen.WIDTH / 2, WindowScreen.HEIGHT / 2);
      My problem is the images resolution are too low if I halved the world screen.
      Can I just set the parameters without '/ 2' or do I must use like this to avoid the later screen-match problems?
      Thank you for your reply and sorry my english is not that good. :|

  • @DeepakGupta-xw2ib
    @DeepakGupta-xw2ib Před 4 lety

    Why did you stopped uploading man, your videos are awsome!

  • @JackyYe_TinyMC
    @JackyYe_TinyMC Před 7 lety

    Is that the gsm.render(batch); in FlappyDemo directly calls the method in menustate
    Also another question...
    How the update method in playstate be called?

  • @JayD1994
    @JayD1994 Před 8 lety

    Instead of "zooming" the camera into the texture, how do I make the texture bigger? I find that zooming into it loses its image quality a bit.

  • @jeremyconley7407
    @jeremyconley7407 Před 8 lety

    Hello I'm pretty new to android but I have made a couple iOS games with spritekit, however with spritekit I didn't use a camera, I simply just moved the background image and repeated it to simulate a movement, and the same with the obstacles, move and remove. Is the camera the only option with LibGdx?

  • @McMurchie
    @McMurchie Před 7 lety

    Shit my version of android doesn't have the 'refactor' only button, it goes to rename then mentions if i would like to apply to all folders and that it can't change directories in libraries or something...

  • @davep7176
    @davep7176 Před 7 lety +1

    Will this method be ok for supporting several screen ratios (like for example if someone had a slightly wider and shorter mobile screen) or would that stretch the images with this code? thanks for any answers in advance

    • @AhmedFaid
      @AhmedFaid Před 7 lety

      same problem and need help too , if you have the answer please tell me , thanks

  • @mertsafak2671
    @mertsafak2671 Před 7 lety

    What should we do to display that program in Android as well?

  • @miebakso293
    @miebakso293 Před 7 lety +1

    Sry can u give me more explanation on the GSM, great work btw

  • @thinkify100
    @thinkify100 Před 8 lety

    +Brent Aureli How do I get my image to match the game background, it's drawing to the screen with a white background. I noticed the bird image got a white background too.

    • @thinkify100
      @thinkify100 Před 8 lety

      *****
      I changed how the image looked in your bird file

  • @samarthsrivastava6220
    @samarthsrivastava6220 Před 7 lety

    What if I only intend the PlayState to be called only after touching the playbutton and not the entire screen?Plz help.

  • @javathehut9910
    @javathehut9910 Před 8 lety

    I am using this video for a different game but I have everything working. When I run I see the clear color I have set so I know I am on the right screen. But when I click nothing happens. I even put System.out.println("hello") to see if it was responding to clicks. Nothing in terminal.

  • @mrjogilsang
    @mrjogilsang Před 6 lety

    If you click on MenuState and the screen disappears,
    Render on PlayState sb.end (); I did not put in. See my experience :)

  • @seanyasnogorodski5927
    @seanyasnogorodski5927 Před 8 lety

    What is the code that if the user just touched on the play button and not the screen

  • @palak2708
    @palak2708 Před 7 lety

    i did all you you said, but my playbutton doesnt responds. it is just in its normal state not going to play state

  • @serdarsurf4900
    @serdarsurf4900 Před 8 lety

    Hi Brent firstly thank you very much for your all useful courses and efforts : ) . I have got menustate, playstate and a gameoverstate. I want to push gameoverstate onto playstate and view both of them at the same time. But gameoverstate is coming with its sb and playstate does not appear. I tried Gdx.gl.glClearColor( 0, 0, 0, 0 ); but it didn't work. sorry my bad en. please help : )

  • @JigaByte
    @JigaByte Před 7 lety +1

    Like for: Basics first!

  • @TheCyberGamerz
    @TheCyberGamerz Před 7 lety

    my game keeps on automatically clicking for me. I don't know if it is an onclick listener problem or the handleinput problem. Somebody plz help!

  • @delgamer377
    @delgamer377 Před 8 lety +2

    Please help me Brent, when i try to rename the "States" to "state" it appear the following "Package 'States' contains directories in libraries which cannot be renamed. Do you want to rename current directory or all directories in project?" and after that it appears some problems which i cant do anything, and it does not changes the name...
    In my flappy Demo the Menu does not appear, instead it goes to the red screen with the bird... I think its because of the problem above, please help me!
    Youre awsome!

    • @TheKingsMindset
      @TheKingsMindset Před 8 lety +2

      +delgamer377 well I did: right mouse click on "States" then clicked "Show in Explorer". you will see the map and you need to rename that map, that should work. But then I had problems with the "dispose" I couldn't generate that. So I turned the map "states" back to "States" and everything worked. I don't know why we should rename it tho.
      what have you done by now ? have you solved the problem? Did you reached the other tutorials? LET ME KNOW asap !!

    • @TheKingsMindset
      @TheKingsMindset Před 8 lety

      Thank you!!

  • @FayzurAlmas
    @FayzurAlmas Před 8 lety

    Package 'States' contains directories in libraries which cannot be renamed. Do you want to rename current directory or all directories in project?

  • @marvinjansen3442
    @marvinjansen3442 Před 8 lety

    Hey, why are you using your own States and not the gdx Class "Screen" ?

    • @keenjus
      @keenjus Před 8 lety +2

      +Marvin Jansen did you watch the video?

  • @MrEueu89
    @MrEueu89 Před 8 lety +2

    Hey Brent, I have a problem renaming my package. First there was a warning saying "Package 'States' contains directories in libraries which cannot be renamed. Do you want to rename current directory or all directories in project?". I have the option to "rename current", "rename all" and "cancel. I've tried both current and all but all I get is a conflict error saying that I cannot create the .java files as they already exist.

    • @DawnfallGames
      @DawnfallGames Před 8 lety

      +Brent Aureli Having the same problem

    • @delgamer377
      @delgamer377 Před 8 lety

      +DawnfallGames +Brent Aureli me too

    • @4everFitnessBlog
      @4everFitnessBlog Před 8 lety

      +Raging Hotdog I had the same problem. I got it to work by clicking "preview" instead of "refactor" in the dialogue box. Then I continued from there and it worked. I don't know why it didn't work by just clicking "refactor". Maybe just a bug. I'm new-ish to Java and Android studio, but it seems confusing that it would say the directories contain libraries, when you just have to import libraries. I feel like it shouldn't matter.

    • @4everFitnessBlog
      @4everFitnessBlog Před 8 lety

      +delgamer377 +Raging Hotdog I had the same problem. I got it to work by clicking "preview" instead of "refactor" in the dialogue box. Then I continued from there and it worked. I don't know why it didn't work by just clicking "refactor". Maybe just a bug. I'm new-ish to Java and Android studio, but it seems confusing that it would say the directories contain libraries, when you just have to import libraries. I feel like it shouldn't matter.

    • @arushverma7670
      @arushverma7670 Před 6 lety

      where the hell is "preview" in the dialogue box

  • @ebadahmed1843
    @ebadahmed1843 Před 8 lety

    can you please tell us What is the code that if the user just touched on the play button and not the screen to start it

    • @santiagolovera
      @santiagolovera Před 8 lety

      +ebad ahmed It happened to me. I had forgotten to implement the update method of MenuState class.
      @Override
      public void update (float dt) {
      handleInput ();
      }

  • @md.razaulhaquesubho4710

    when i click on my app in the play button it shows a black screen .. but why the red background and the bird dont show ??

    • @santiagolovera
      @santiagolovera Před 8 lety +2

      +Shuvo Opu It happened to me. I had forgotten to implement the update method of MenuState class.
      @Override
      public void update (float dt) {
      handleInput ();
      }

  • @MrTian1995
    @MrTian1995 Před 8 lety

    Help, when I type "cam" then I get an error says : "Cannot resolve symbol 'cam'".
    am I miss something? I already follow your step like this video, but I still get an error.
    Thanks for this tutorial man! Subscribed! :)

    • @MrTian1995
      @MrTian1995 Před 8 lety

      Solved..I just know what make my code get an error, I rename 'cam' variable to my own variable. Hahaha

  • @timcrouch2415
    @timcrouch2415 Před 8 lety

    Very nice tutorial series! As a side note, I actually did not realize that the camera had an option to make Y count up as you go down the screen (I am very new to LibGDX). I would highly suggest to anyone to set 0, 0 to be in the upper-left hand corner. That is because this is traditionally where it is in most other game frameworks and platforms (in fact, LibGDX is the only one I have ever seen to place it in the lower-left hand corner by default). So if you ever need to look up help to a question or want to look at other people's code for other frameworks, you won't have to be converting everything in your head or your code to be an origin in the lower-left. It is kind of nice to have it match the Cartesian coordinate system, but it just isn't a common practice in game development.

    • @islemdjarallah1564
      @islemdjarallah1564 Před 7 lety

      +Brent Aureli
      can you ansr.me.plz
      when i click playBtn the background becom BLACK and the bird did't show !!!

  • @RealNatsuri
    @RealNatsuri Před 7 lety

    Hello there,
    I have a problem, my program doesn't seem to call my "update()" method at any time, so the button never works.
    Can anyone help me ?

    • @pedrihub2658
      @pedrihub2658 Před 7 lety

      Remove comment slashs from file State.java

  • @Jlaubster
    @Jlaubster Před 8 lety

    couldn't you just scale the image up when you draw it into the world? instead of changing the viewport

  • @islemdjarallah1564
    @islemdjarallah1564 Před 7 lety

    i have a problem when i clik playBtn the background become Black!!!! and the bird didn't show
    plz help !!

    • @islemdjarallah1564
      @islemdjarallah1564 Před 7 lety

      in gamestatemanager in "set" methode,
      public void set(State state){
      state.pop();
      state.push(state);
      }
      pop then push

    • @Kadreami
      @Kadreami Před 7 lety

      I had the same problem. In the handleInput() method of the MenuState class, I had put dispose() outside of the if statement (and it needs to be inside the if statement).

    • @DanisableProgramacion
      @DanisableProgramacion Před 7 lety

      thanks! that work it!

  • @mechtarin
    @mechtarin Před 4 lety

    you put a button but not used just a texture

  • @ridhwaanany7480
    @ridhwaanany7480 Před 8 lety

    When I click the screen and transition into playState my texture is black. Why is this?

    • @islemdjarallah1564
      @islemdjarallah1564 Před 7 lety

      Me too did uou solv it?? plz ansr me !!!

    • @islemdjarallah1564
      @islemdjarallah1564 Před 7 lety

      +Islem Djarallah
      in gamestatemanager in "set" methode,
      public void set(State state){
      state.pop();
      state.push(state);
      }
      pop then push

  • @ryanjcurran2
    @ryanjcurran2 Před 8 lety

    I'm using my phone to emulate the app and so far it does so horizontally :( I've tried switching the height and width values and even their place in the code but it's still horizontal somebody pls help :c

    • @FriskyBearGaming
      @FriskyBearGaming Před 8 lety

      Skip to the final video of the series and watch the first minute or so..

    • @ryanjcurran2
      @ryanjcurran2 Před 8 lety

      +Joseph Harris I gave up :p I'll try something else :)

    • @explore-planet-earth
      @explore-planet-earth Před 8 lety

      Go to AndroidManifest.xml and update the activity sreenOrientation line to Landscape to portrait ( android:screenOrientation="portrait")

    • @ryanjcurran2
      @ryanjcurran2 Před 8 lety

      +Saravana Raja I got this! Thanks for your help stack overflow is godly. do you know how to ad admobs with firebase? I've tried several hundred million times to no avail I'm starting to think it's impossible :p

    • @explore-planet-earth
      @explore-planet-earth Před 8 lety

      That's good u got the solution. Sorry ryan i'm new to fire base.

  • @MattiaGariselli
    @MattiaGariselli Před 7 lety +1

    dio cancaro

  • @yourfavouriteman
    @yourfavouriteman Před rokem

    A few seconds ahead the video starts to blur & makes it barley impossible to see !!!!!!!!!!!