Intro to a Main Menu - 1 - Pico 8

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 38

  • @NerdyTeachers
    @NerdyTeachers  5 лет назад +4

    Version 2 is a better way to build states into your games, watch and read the detailed tutorial at NerdyTeachers.com/Explain/MainMenu2

  • @igorbusquets7339
    @igorbusquets7339 5 лет назад +9

    Awesome! Keep going with this very good level of teaching! makes me wanna make games every time I watch any of your videos!

  • @Anilmky
    @Anilmky 4 года назад +2

    These tutorials alre so easy to understand, It makes programming looks a loot easyer.

  • @rmorganslade
    @rmorganslade 4 года назад +2

    Just starting to get into Pico-8 and I'm super thankful for these tutorials because they're so easy to follow!

  • @kellybmackenzie
    @kellybmackenzie 2 года назад

    This is awesome, thank you so much!!

  • @loganblizzard6869
    @loganblizzard6869 5 лет назад

    Amazing! It took me a little bit to figure out how it would go in with the platformer but when I was done it was amazing

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      Awesome! Glad you were able to figure out how to implement it into your platformer. Well done!

  • @willshrly76
    @willshrly76 5 лет назад +1

    Excellent tutorial, thanks for your teaching.

  • @chaseniwa7971
    @chaseniwa7971 5 лет назад +1

    keep em coming guys. dont give up

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад +1

      Haha will do! Just getting settled at a new school, so still have to find the time for more video production.

  • @xcreatorminigames6227
    @xcreatorminigames6227 5 лет назад

    Another amazing tutorial. The simpler way I think to do that is making a variable called ex. _UPD and another called _DRW just assign the state function to it like _UPD = UPDATE_TITLE and _DRW = DRAW_TITLE when the state change just change it. This way avoid comparing string which is slow.

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад +1

      Exactly, this cuts out the middle man. We plan to introduce this method in Version 2. It's a great lesson in coding efficiency to understand this Version 1 and then see how we can remove the string comparison entirely. There is also Version 3 which uses functions in tables, and Version 4 which uses coroutines. But we'll see if we ever get that far.
      We're glad you commented though, since it gives people a sneak peek at how to improve upon it, and we've had to slow down our video output, unfortunately, so we're not sure when we'll get to it.

    • @xcreatorminigames6227
      @xcreatorminigames6227 5 лет назад

      Amazing my friend, so we are want to the next great tutorial, you guys are really clear on explaing this things, thanks!

  • @tracyburnham604
    @tracyburnham604 5 лет назад +2

    I tried to combine this demo with the previous Fruit Drop demo to add a menu but the Fruit Drop game has an _init() to complete the loop and this resets the entire game back to the main menu. What do you recommend I can replace that code with to respawn the fruit?

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      Great question! We actually recommend using the Main Menu Version 2: nerdyteachers.com/Explain/MainMenu2
      But either way, you can take Fruit Drop's _init( ) code and change the function name from _init( ) to make_fruit( ). And change where we called _init( ) as well (after there are no more fruit in the fruits table) so that it calls make_fruit( ) instead. That should be all you need to do! But let us know if you run into trouble. =)

  • @lorki3
    @lorki3 5 лет назад +1

    This is a great tutorial!

  • @josephstalin5347
    @josephstalin5347 5 лет назад +2

    please dont stop making these videos

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      Sorry for the long break, but we are currently focused on getting some new features built into the website to enhance future lessons but we will definitely return to make more videos as soon as we can! We're also preparing improvements to the making of future videos as well. Thanks for the support!

    • @josephstalin5347
      @josephstalin5347 5 лет назад

      @@NerdyTeachers I am good with HTML CSS JavaScript and MySQL, is there anyway I could help out and work for you guys?

  • @Cerbyo
    @Cerbyo 5 лет назад

    Having serious problems with inputting this in an existing game. I have an existing game made of:
    function _init()
    function _update()
    function _draw()
    function a()
    function b()
    Everything works fine as is. When adding in this code though it identifies variables in a() and b() as nil. All code in the original update() is pasted into the update_game(), same process for draw. Then the update function and update_menu are setup same as u have in the video. It loads fine when run but as soon as I change to the game state it crashes.
    If I rename update_ game() to _update() and delete the old _update and update_menu...and repeat this for draw.....the game goes back to working fine. Somethings wrong, does this code not work if you have other functions dangling around? The functions are only called in update and draw of the gamestate. the values of certain variables for them are in init(). init always runs.

    • @Cerbyo
      @Cerbyo 5 лет назад

      problem was i defined a variable in a function rather than in init...for some reason it worked fine when run in the game state....but loading into the gamestate it didnt. even more confusing it worked when loading from gamestate and switching back and forth to menu and game...worked fine. but loading menu first and switching...no.

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      @@Cerbyo, glad you found the problem. When you are defining variables, consider where they will be used. If you will use them in multiple functions and game states then put them in _init() which will set the variable before any other functions are run, so they can be used anywhere.
      But if the variable is only used in one function then you can define it inside that function and also write "local" before the variable name to make it only used inside that function. Without "local", a variable defined in a function can be read outside the function but only after that function runs the first time. This is probably why you are seeing it work when certain functions run before others but not work when you run the functions in a different order.
      Hope that helps clear things up! Keep up the awesome game dev fun in Pico-8!

  • @PossumMedic
    @PossumMedic 3 года назад

    Great vid thanks! :D

  • @CCV334
    @CCV334 4 года назад

    Updated link to the main menu: nerdyteachers.com/Explain/MainMenu1/

  • @instyxx
    @instyxx 5 лет назад

    very great ! I want more !

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад +1

      Glad to hear it! Check out the website for how to improve this with Version 2. We only have enough time right now to add to the site, but hope to make more videos soon. =D

  • @Cerbyo
    @Cerbyo 5 лет назад

    Setting up functions like that seems messy. I'd rather stick to the 3 main functions where possible. Setup variable in _init. then just make draw and update into big IF statements. function _draw()
    If menue="main" then.....
    else.....
    end end
    I wonder if there's a better way to do it still though, using tables. Could make variables like player ={menue= {},game = {}} then divide all between player[1] and player[2]. That might not work well tho and get too confusing and u might need to call it in draw/update twice anyways.

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      In Lua, functions are held in variables. So in the improved main menu, we can avoid the slow IF statements by creating custom init, draw, and update functions and then set them as the main functions, making them active, like this:
      _update = update_menu
      _draw = draw_menu

  • @qurez3590
    @qurez3590 3 года назад

    copy the video but didn’t work for me

    • @NerdyTeachers
      @NerdyTeachers  3 года назад

      Try to compare your code with the full code in our website help page to see if you can spot the difference. The link is in the description.

    • @qurez3590
      @qurez3590 3 года назад +1

      @@NerdyTeachers thx it helped but i have a question. I copied the code it works good but if i press x there is a green ball like in the video. I can i change it too my own world?

    • @NerdyTeachers
      @NerdyTeachers  3 года назад

      @@qurez3590 You definitely can! If you already have a game written then check out our 3rd Main Menu video to see an example of how we took a premade simple game and added the improved main menu to it.
      You can take whatever code we show you and tweak it to fit your game, or start building your game from this starting point. Messing around with the sprites and numbers in any of our tutorials is a great way to learn.

  • @johndripper
    @johndripper 4 года назад

    thanks can u make tutorials for tic 80 too pls coz pico 8 is not free and so inaccessible to most users without buying it :/

  • @chaseniwa7971
    @chaseniwa7971 5 лет назад

    please finish this seriiies

    • @NerdyTeachers
      @NerdyTeachers  5 лет назад

      I knowwwww, we gotta get on ittt, thanks for the nudge! We will put together another video this week! Thats a promise!

    • @chaseniwa7971
      @chaseniwa7971 5 лет назад

      @@NerdyTeachers hey life comes first bro. just remember you got fans out here!

  • @p0kepengin592
    @p0kepengin592 Год назад

    this voice is killing me