how do i make doors appear when entering a room? (topdown roguelike binding of isaac style game)

0 favourites
  • 5 posts
From the Asset Store
9 orchestral + 9 alternate chiptune-style arrangements of dynamic, RPG-style music for your media project.
  • sooo, im participating in a game jam, in which i decided to make a roguelike topdown, with great difficulty i managed to write my own code to create rooms, camera in zones, and create walls (with space for doors if there is a room next door for example)

    (without the camera code, the rooms look like this)

    they are generated randomly, with some filters to avoid bugs

    when i start playing, i have some paths to go, like in the binding of Isaac, i would like a boss room, rooms with power ups and a door that indicates what each room is, another point is that when i enter a room, i would like that enemies appeared, the doors closed, and only opened when defeating all the enemies (and save that i defeated that room in case i return to it) im very confused by the idea of ​​object spawns, what could i do? I can send the project if necessary (ps: the code is unnecessarily large with codes that i believe could be removed)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Depends how you generate the rooms. If at the point of generating the room you can designate it a boss room then there you go. Maybe the way you generated them does not allow you to easily 'pick rooms'.

  • well, that would be sad, i did some kind of filters/checks during room creation, i hope that somehow i can think of some solution

  • how did you create the rooms ? :)

  • I have three variables, two of them randomly generate the position (x and y) and the other generates the number of times the code will repeat (number of rooms)

    If a room is born diagonally, and there is no room next to it, it is impossible to access it, so when creating a room, an object is created on: the left, right, top, and bottom of the room, if the room does not collide with this block, it means that it is impossible to access it normally, and the game generates a room again

    there is another object in each possible position that can be generated a room, if the room collides with this object, it gains a room number (which is also saved in an array)

    with the array, I know the exits possibilities, and I create walls that way

    I also have a filter that prevents two rooms from being born in the same position, to avoid an bug that causes only 2 rooms to be spawn

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)