devDiary, Puzzle games need an Inventory

Поділитися
Вставка
  • Опубліковано 4 січ 2025

КОМЕНТАРІ • 7

  • @jeffreygordon7194
    @jeffreygordon7194 16 днів тому +1

    Underneath there's a function that takes some sort of object that describes which key was pressed. You just need to read the controller and make an object that spoofs the key object with the corresponding key and pass that along to that function. If the key is read inside the same function that executes the inventory change, then start by breaking out the keycheck into its own function. You're doing great.

    • @Catskullgames
      @Catskullgames  16 днів тому

      cool, thanks for the advise . if i get what your saying, have a function to interact with interactable objects but then put a key term on interactable objects to be picked up. when the button is pressed to interact with objects check if it has the key term. if true, pick up.

    • @jeffreygordon7194
      @jeffreygordon7194 16 днів тому +1

      ​@@CatskullgamesI think we're on the same page. Basically figure out how it works with the keyboard and spoof that with the controller. It's probably just a string like 'RIGHT_ARROW', or maybe one inside of an object, so when you read d-stick right, you pass along the correct string. If the function that reads the keyboard doesn't have single responsibility, start by splitting it out into {string} key_check(). Then make {string} controller_check().

    • @Catskullgames
      @Catskullgames  14 днів тому

      yes, GDScript uses different syntax but I get it, that is so cool. thanks

  • @loscore2
    @loscore2 19 днів тому +1

    Sick vid

  • @timm-from-hit-game-papa-louie
    @timm-from-hit-game-papa-louie 19 днів тому +1

    nah. portal doesn't yet it's regarded as one of the best puzzle games ever