PICO-8 Top-Down Adventure Game Tutorial - Step 3/10

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

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

  • @ooooggll
    @ooooggll 3 года назад +5

    I love how he actually explains things as opposed to most coding tutorials. It makes it easy to actually understand what's happening rather than just copying from the video.

  • @jamesyork
    @jamesyork 4 года назад +11

    This one was tricky, I've had to come back to it to check my understanding again. Thank you. I hope to be able to make a version from memory (without checking these tutorials) soon :)

  • @magimight859
    @magimight859 4 года назад +3

    Thank you for this series!! Collisions have been driving me crazy!

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

    This is the point my brain starts to melt. I really need to study this.

  • @ninjagarcia9999
    @ninjagarcia9999 3 года назад +2

    When i follow this code my character can walk through the sprites with the flag on it and the sound plays.

  • @Nenga117
    @Nenga117 2 года назад +1

    So I've typed the functions for Tiles MGET, FGET and movement, however my player sprite is not being able to move past floor tiles after a certain point of the map. Some wall tiles work and some dont.
    would you happen to know why? cant seem to find an answer

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

    Mine just won’t move.

  • @Ediblespaceship273
    @Ediblespaceship273 2 года назад +1

    my character can move but collisions/sfx isnt working. if anyone knows why please tell me.

    • @TindallB-Gamedev
      @TindallB-Gamedev 2 года назад

      for me it was this function, here is the correct version
      function is_tile(tile_type,x,y)

  • @Sniper_Fam101
    @Sniper_Fam101 2 года назад +1

    How do I fix this error it keeps coming each time I press Control+r:
    Runtime error line 25 tab 1
    Return not is_tile(wall,x,y)
    Attempted call global “is_tile”
    (A nil value)
    In can_move line 25 (tab 1)
    In move_player line 24 (tab 2)
    In _update line 9 (tab 0)
    At line 0 (tab 0)
    I don’t know what to do I am stuck and this is my first time using pico 8

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

      Someone help

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

      @@Sniper_Fam101 did you ever get this figured out? I am getting the same error and can't figure out why

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

      @@gamequestgb maybe that is an old code so it doesn’t work today

  • @steve_cdh7324
    @steve_cdh7324 4 года назад +1

    when ever i do ctrl+r to run it takes me to the help menu. help me please

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

      Supersuds playz mine just started doing that.
      Edit: you have to press ctrl s to save first.

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

      Save by pressing CTRL+S and THEN press CTRL+R.

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

      Check if your functions in the game loop _init, _update, and _draw have underscores before them. Then try to run it.

  • @ThePaintStick
    @ThePaintStick 8 месяцев назад

    help!:it gives me an error!

  • @cheshirecreeper3743
    @cheshirecreeper3743 4 года назад +1

    Sorry, I have another problem. Here's my code for the movement options, it says that i'm calling a nil value again in the update function.
    FOR TAB 2:
    function move_player()
    newx=p.x
    newy=p.y

    if (btnp(➡️)) newx-=1
    if (btnp(⬅️)) newx+=1
    if (btnp(⬆️)) newy-=1
    if (btnp(⬇️)) newy+=1

    if (canmove(newx,newy)) then
    p.x=mid(0,newx,127)
    p.y=mid(0,newy,63)
    else
    sfx(0)
    end
    end
    FOR TAB 1:
    function is_tile(x,y,tile_type)
    tile=mget(x,y)
    has_flag=fget(tile,tile_type)
    return has_flag
    end
    function can_move(x,y)
    return not is_tile(x,y,wall)
    end
    Thanks again!

    • @cheshirecreeper3743
      @cheshirecreeper3743 4 года назад +1

      Never mind, I figured out the problem, it was basically just me typing incorrectly and forgetting basic things. Thanks for creating this tutorial series by the way, it's helped me out a lot

    • @DylanBennett
      @DylanBennett  4 года назад +6

      @@cheshirecreeper3743 Glad you caught the error! My only advice would be to try not to get too frustrated with problems like that. Those little errors are more common than you might think. I have been programming for 30 years and I make those kinds of mistakes *all the time*. Literally. Usually the error message will point you to the right line, but not always. But 9 times out of 10 it's a little error like that. I'm happy to help any time you need it.

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

    That's all for today teach. see ya tomorrow!
    Thanks! :D

  • @roachdoggjr3235
    @roachdoggjr3235 4 года назад +1

    My little character is alive! But can't can't go left?

    • @DylanBennett
      @DylanBennett  4 года назад +1

      Double check when you're listening for the button presses in the move_player() function that you have newx-=1 for the left button and newx+=1 for the right button.

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

    i dont know why, but my character doesnt move like that, its moves "Diagonaly", What am I doing wrong?
    the code:
    --player code
    function make_player()
    p={}
    p.x=3
    p.y=2
    p.sprite=1
    p.keys=0
    end
    function draw_player()
    spr(p.sprite,p.x*8,p.y*8)
    end
    function move_player()
    newx=p.x
    newy=p.y

    if (btnp(⬅️)) newx-=1
    if (btnp(➡️)) newx+=1
    if (btnp(⬆️)) newy-=1
    if (btnp(⬇️)) newy+=1

    if(can_move(newx,newy)) then
    p.x=mid(0,newx,127)
    p.y=mid(0,newx,63)
    else
    sfx(5)
    end
    end

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

      I have the same promblem, did u solve it, if so can u tell me why it moves like that

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

      could you maybe send your map code?

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

      @@fireball4285 i fixed my problem

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

      @@Ingb3rg what did u do

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

      @@Ingb3rg wait how I have the same problem

  • @chaocist9703
    @chaocist9703 3 года назад +2

    I have looked at the cheat sheets and rewatched this video 3 times and my character still doesn't move
    my code:
    -- game loop
    function _init()
    map_setup()
    make_player()
    end
    function _uptdate()
    move_player()
    end
    function _draw()
    cls()
    draw_map()
    draw_player()
    end
    -- map code
    function map_setup()
    wall=0
    key=1
    door=2
    anim1=3
    anim2=4
    lose=6
    win=7
    end
    function draw_map()
    map(0,0,0,0,128,64)
    end
    function is_tile(tile_type,x,y)
    tile=mget(x,y)
    has_flag=fget(tile,tyle_type)
    return has_flag
    end
    function can_move(x,y)
    return not is_tile(wall,x,y)
    end
    --playercode
    function make_player()
    p={}
    p.x=10
    p.y=10
    p.sprite=5
    p.keys=0
    end
    function draw_player()
    spr(p.sprite,p.x*8,p.y*8)
    end
    function move_player()
    newx=p.x
    newy=p.y
    if(btnp(⬅)) newx-=1
    if(btnp(➡)) newx+=1
    if(btnp(⬆)) newy-=1
    if(btnp(⬇)) newy+=1

    if (can_move(newx,newy)) then
    p.x=mid(0,newx,127)
    p.y=mid(0,newy,63)
    else
    sfx(0)
    end
    end
    does anyone know how to fix this?

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

      I noticed one tiny typo! You have _uptdate() instead of _update() Hopefully that fixes it! If not, let me know and I'll be happy to help.

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

      @@DylanBennett OOHHHHHHHHH

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

    ta travado de lança meu boneco, to com dificuldade...