Live Coding Snake with Pico-8 in 20 minutes

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 28

  • @DeepFriedOreoOffline
    @DeepFriedOreoOffline 3 роки тому +9

    My main problem when it comes to programming is that I always have a desire to do things in the most high-concept way I can fathom, which leads to stress and eventual abandonment when I realize my perfectionism has taken over... It was very nice to see this sort of approach to programming in Pico-8, and I feel like I should be well equipped to make a simple little snake game!

    • @TheBest-sd2qf
      @TheBest-sd2qf 2 роки тому

      This way of programming is really good for smaller projects, but not larger ones. You'll soon get lost in thousands of if/then loops etc.

  •  4 роки тому +4

    Biiiig thanks! I actually had to watch it on 0.75 to duplicate every line myself, to learn how to code. I'm a super begginer and I searched for snake on Pico8 and I have to tell you I'm very happy you made this. :)

    • @AustinMerrick
      @AustinMerrick  4 роки тому +3

      Woo! I'm glad it helped! Good luck on your pico8 journey

  • @LiamsCR
    @LiamsCR 4 місяці тому

    Great video, hope you are well!

  • @AustinMerrick
    @AustinMerrick  4 роки тому +11

    Pro tip: watch in 2x speed for snake in 10 minutes :^)

  • @retsapb6319
    @retsapb6319 3 роки тому +1

    This helped me A LOT with understanding Pico8 and Lua. Great video

  • @wilsonfromwales
    @wilsonfromwales 3 роки тому +1

    Great tutorial! I would love to see more tutorials for games like this. Question about the tables: Why do you write the code as snake = {} followed by snake.x=3, snake=y=2 etc... instead of putting the values inside the {} as snake={x=3,y=2}?

    • @AustinMerrick
      @AustinMerrick  3 роки тому +1

      Thanks for the kind words! Functionally both methods of adding entries to the snake table are equivalent so you should go with whatever you prefer. I just arbitrarily decided to go with my way :^)

    • @SquidBeats
      @SquidBeats 3 роки тому

      Jesus Christ is God Almighty and is the only way! God is very real. I didn’t think of changing how I am now

  • @nossvelic
    @nossvelic 2 роки тому

    Thanks man i enjoy your video so much!!. I hope to work in the code and give my own twist. Greetings form argentina!!

  • @shoespeak
    @shoespeak 3 роки тому

    lol it took me like 3 days to get my own version of snake :( i am still having trouble with making the controls "roll' instead of having to hit them on the right game tick

    • @AustinMerrick
      @AustinMerrick  3 роки тому +1

      grats on getting your own version done! and yeahh, buffering input is a tricky problem but there's two approaches you can take. 1) whenever player inputs a move, let the next frame be a game update. this will allow a player to easily chain direction changes, but has the side effect of actually speeding up the game when a lot of inputs are activated. 2) have a move queue. each time the player presses a button, place it in the move queue. each snake update pops and does the next up move if the move queue isn't empty.
      let me know if you still have troubles. maybe i can word it better or give you some example code :^)

    • @DeepFriedOreoOffline
      @DeepFriedOreoOffline 3 роки тому +2

      If it helps, the easiest way to go about this is probably a 1-key input buffer. What you would want to do is have a global variable that you use to store if an input key has been pressed. Then during every update, before checking to see if the snake's tick has counted down, check to see if the player is pressing an input. If they are, set the input buffer to that key. Then, whenever the snake's tick is triggered, check to see if the buffer variable is nul. If it's not, set the direction and make it nul, otherwise just move the snake in the current direction.

  • @manuel1876
    @manuel1876 3 роки тому

    pretty cool! At what age did you start programming?

  • @NikolajLepka
    @NikolajLepka 3 роки тому +1

    why not just define the snake in-line?
    snake = { x = 2, y = 2, dx = 1, dy = 0 }
    saves a bunch of tokens too

    • @lemonhashberry5799
      @lemonhashberry5799 2 роки тому

      From a token standpoint I agree with your point, even if the OP arbitrarily prefers that method of coding the table up.

  • @TheBest-sd2qf
    @TheBest-sd2qf 2 роки тому

    I dont like the Pico font, 8 bit computers didn't this kind of primitive font.

  • @SquidBeats
    @SquidBeats 3 роки тому

    Jesus Christ is God Almighty and is the only way. God is very real. I didn’t think of changing how I am now