ChenBr's Recent Forum Activity

  • Basically layouts is the proper method.

    But you can get away with teleporting if your game is not too large, which could be a lot simpler to implement.

    Thanks!

  • Layouts allow you to manage your graphical memory, only sprites that are used in any particular layout are loaded into memory. It will allow you to have a greater variety of textures between layouts.

    Having everything on a single layout might be simpler to execute, but you might run into memory limitations. Depends on the scope of your game.

    Also "time" does not pass across layoyuts, which may be a consideration.

    Alright, thanks for the great answer!

    Except "time" which isn't a problem for me, are there any more limitations?

  • Layouts are a good way to make rooms. Familiarize yourself with the "Global" property and "Persist" behavior, which you can read more about in the manual.

    An alternative way is to build all your rooms on one layout in a separate area, and teleport your player sprite around.

    Alright, thank you for your suggestions.

    May I ask what are the cons and pros of each method?

  • Hello,

    In my game I move between rooms, I have HP, Armor and more variables.

    I was wondering what is the best way of making multi rooms, should I make more layouts? is there any other way?

    If I need to create more layouts, how do I save all the stats?

    Thanks!

  • I'm not sure I understand what you're trying to do, are you trying to make them visible while touching, or you want it to stay visible after you make a click?

    Can you show the event sheet?

  • If you move the finger outside the sangPad, dragging will be interrupted, because sangStick can't move further.

    That's why you need a separate invisible sprite that can be dragged freely.

    It's a popular trick, you can see an example here:

    Oh, now I understood what you meant!

    Successfully did it, thank you very much

  • You can't use drag&drop on the same sprite.

    Create another (invisible) sprite with Drag&Drop behavior, say "dragSprite".

    Remove Drag&Drop behavior from the "sangStick".

    Change events to this:

    dragSprite is dragging -> set AreaAngle to angle(sangPad.X, sangPad.Y, dragSprite.X, dragSprite.Y)

    .................set AreaDistance to distance(sangPad.X, sangPad.Y, dragSprite.X, dragSprite.Y)

    The rest is the same.

    When not dragging, return both sangStick and dragSprite to sangPad posision.

    Shouldn't that work?

    I don't really understand why I need to use a second sprite to define the drag, the drag also define me the conAngle that defines the player movement, there's no way to use the same drag and drop that I already have?

    something like that

  • Like that?

  • Here you go:

    https://www.dropbox.com/s/h67nu1sqfome3 ... .capx?dl=0

    You can replace event #2 with this:

    Small->Set position to Big

    Small->Move at angle (angle=a, distance=d)

    Hey, I was trying to do the same like that

    But it doesn't work, maybe becuase of something that is written here?

    Thanks for your time

    Edit: I have 2 joysticks in the game if that matters

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Here you go:

    https://www.dropbox.com/s/h67nu1sqfome3 ... .capx?dl=0

    You can replace event #2 with this:

    Small->Set position to Big

    Small->Move at angle (angle=a, distance=d)

    Thank you very much!

  • Hello.

    I have a joystick in my game that is working with no problems.

    Now, what I want to do is settling the dragging area, right now, it doesn't matter where I drag the stick, it will just follow wherever I touch.

    So I want to define the stick a specific area that the stick couldn't get out of.

    This is the stick

    And I want it to not be able to get out of this area

    But, when I'm out of this area with my finger (or mouse), I want the joystick to keep dragging the stick, so I could get the angle from the joystick virable, but the stick won't bother the player while he's dragging the stick (whenever the player is dropping the stick, he gets back to the original spot.)

    Thanks!

  • What about doing something like that?

    If you have more than 1 frame, you can add another virable that will include the number of your frame (each time the frame is changed, he gets 1)

    this way you could change the frame to 0 + FrameVirable

ChenBr's avatar

ChenBr

Member since 11 Mar, 2018

None one is following ChenBr yet!

Trophy Case

  • 6-Year Club
  • Email Verified

Progress

7/44
How to earn trophies