what is offset? also what is the function parameter?

  • hI, I have see these being used in the kiwi events, could some one explain what they mean please?

    I am having a really hard time with functions and using them. Although I am practicing now. Read the manual and still confused.

    Thank you

  • Function parameters can be used to pass data to the function.

    Imagine you have a function "PlayerAddHealth", you need to tell it how much health points you want to add. So you do this with a parameter:

    Player on collision with HealthPotion
    ... Function Call "PlayerAddHealth", parameter: 20
    
    On Function "PlayerAddHealth"
    ... Player add to health Function.param(0)
    ... StatusText set text "Healed for " & Function.param(0) & " points!"
    

    .

    As for the "offset", I don't understand your question. Which offset?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks buddy,

    sorry for the late reply. I see, that's actually really handy (the parameter part. I think I have been avoiding funtions so I am going to spend a day and create a simple game where I can practice with functions and get a full understanding of how and where to use them in the event sheet)

    Offset parmeter i see alot in the kiwi game, like if player is against wall, set offset to x-32, y, -122. I assume its just used as position for the player.

    Thanks mate, have a fab new year :-)

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