Borgi's Forum Posts

  • You have got teleported into the ground which is solid

    One solution could be:

    You could disable player input for a short duration of time and make your character jump.

    Even set jump strength/gravity to different from the standard one you use otherwise.

  • When testing overlapping add condition:

    System -> Compare two values -> Lshape.Angle = LshapeInBg.Angle

    Also a foreach might be needed for Lshape

  • This works like that you descripbed.

    A solution could be to move the player further then the other door when moving through the door. Like teleport him to in front of the other door. not inside it

    Event - Player on collision with Door 1

    Action - (move position-player moves to Door 2 + SOME_MORE)

    Event - Player on collision with Door 2

    Action - (move position-player moves to Door 1 + SOME_MORE)

    Or set a flag 1 when the player has moved through the door and set it to 0 when its not overlapping door, and only let it move through when this flag is 0.

    Event - Player on collision with Door 1

    Event - AND MoveThrough = 0

    Action - (move position-player moves to Door 2)

    Action - Set MoveThrough = 1

    Event - Player on collision with Door 2

    Event - AND MoveThrough = 0

    Action - (move position-player moves to Door 1)

    Action - Set MoveThrough = 1

    Event - NOT(Player overlapping with Door1)

    Event - NOT(Player overlapping with Door2)

    Action - Set MoveThrough = 0

  • To jump on random Layout you could use "Go to layout (by name)" -> name them with a string + (number from 0)

    But, your platformer map loading makes a lot of sense, why can not you use it like that in your minigolf game?

  • A possible solution:

    create an instance variable for the obect, for example -> DeleteOrder

    On start of layout, set all of the instance of these object DeleteOrder to floor(random(Object.Count))

    Create a local variable, for example, NumberToDelete = 5

    Now use an ordered foreach based on DeleteOrder on the object you want to delete and add an other condition here, where NumberToDelete > 0

    action: delete Object, Subtract 1 from NumberToDelete

  • Check your mouseY -> that cos sohuld be sin there!

    It sohould not move less and less.

    If you can not find a souliton share your capx and we will heve a look

  • You can use polar cordinates:

    https://en.wikipedia.org/wiki/Polar_coordinate_system

    You generate an angle -> ANGLE = random(360)

    and a distance -> DIST = random(100)

    The new destination position of your sprite will be:

    x = current.X + cos(ANGLE) * DIST

    y = current.Y + sin(ANGLE) * DIS

    Or it can be simplier if the distance can be in manhattan distance, you can simply use something like this:

    x = current.X + random(200) - 100

    y = current.Y + random(200) - 100

  • Some serious events are going on:

  • Random(0,15) generates a number from 0 to up to 15, but not 15.

    With floor, he makes this random number an integer.

    You could use this, with Floor(Random(45)) -> this will generate an integer between 0 and 44.

    Generate 30 of these.

    After that, loop through the array, and base on what the value of the array -> create your object.

    Generate different object based on all the random value could be in the array

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can set the origion point ofthe button to its center and you can also set the "Hotspot" for SpriteFont. Put them at the same position (X,Y). Now you can freely scale them as you want, the text will always be at the center of the button

  • You can make a variable which is for example 0 when the player can control the hero, and 1 when the hero is hurting (lets call it HERO_STATE). Like a very basic state machine. And an other variable will also be good to detect which direction should the hero "hurt" (HERO_DIRECTION). So, I would make it like something like this:

    • HERO_STATE = 0

    -- enable Hero player input

    + add standard movement events here as subevents

    • HERO_STATE = 1 and HERO_DIRECTION = 0

    -- hero -> move left

    -- wait x

    -- set HERO_STATE = 0

    • HERO_STATE = 1 and HERO_DIRECTION = 1

    -- hero -> move right

    -- wait x

    -- set HERO_STATE = 0

    • on hero collision with enemy

    -- set HERO_STATE = 1

    -- disable Hero player input

    -- hero -> jump

    -- set HERO_DIRECTION = Hero.X < Enemy.X ? 1 : 0

    You also should handle when they are at the same position, or let it be like this.

  • I would disable player control for the hero for a period of time, and use "simulate control" for a jump with the correct direction. You can even set the platform behaviour properties up, like smaller jump.

  • From my experiences, var2 would be set first.

    I find the "OnCreated" event is like a parameterless constructor in programming languages.

    I wanted to do something like what you did here and I had to use a seperate instance variable "JustCreated" with default value 1. I set up my object when it is 1 and immediately set it back to 0. It is not event based, but works fine.

  • I can not try it our right now, but isn't this newly added feature solves the problem?

    https://www.scirra.com/construct2/releases/r212.2

    "The ability to hold shift and drag the right mouse button over a tilemap to select a patch of tiles"

  • I am not 100% sure, but I think blending might help you:

    https://www.scirra.com/manual/146/effects

    "Destination out" looks like what you have described

    edit: typo