dop2000's Forum Posts

  • LiteTween is an overkill for this task if you just need a linear change.

    X=X-300*dt is the easiest formula

    If you don't care about it taking precisely 1 second, you can simply subtract 5 every tick:

    X=X-5

    At 60fps it would take approximately 1 second to decrease by 300.

    You can do this with lerp if you want, but you will need another variable "t":

    t=t+dt

    X=lerp(-300, -600, t)

  • If you need to change from -300 to -600, that's actually decreasing

    Try this:

    X=X-300*dt

    This should decrease X by 300 every second.

    To stop after 1 second, you can either set a condition "If X>-600" or add Clamp() or Max() expression, for example:

    X=Max(-600, (X-300*dt))

    If you want easing effects (speeding up/down etc), you can install LiteTween behavior.

  • Why did you remove 4 actions from the "DisplayINVContent" function? Restore them and your inventory will work.

    Did you delete and then re-added invCell sprite or Collectibles family? You should be careful when you delete an object in C2, as all events and actions mentioning this objects are automatically removed from the event sheets.

    I suggest you compare your code with the previous version (the one you uploaded a few days ago) to make sure nothing else is missing.

  • sean080

    It's the same check as in my example - if distance between two sprites less than some value, then enable bullet behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • See this example:

    The system will check event 1. If it's true, other checks will not be performed.

    If 1 is false, then event 2 will be checked.

    If 2 if false too, then event 3 will be executed.

  • You can have several Else conditions:

    A=1  ....
    B=1
    
    Else   ....
    C=1
    D=1
    
    Else ....
    [/code:1ym1hzxh]
    
    I should note that this kind of programming is not very efficient. If you have lots of events like this or add more variables, your code will soon become very difficult to manage. You should probably choose another way to store all these values, maybe a dictionary, or an array. You can store recipes  as strings of keys: (BigTowerRecipe="burger,piper,maioneza") and use tokenat, tokencount to parse them and loop through the dictionary to check if ingredients are available.
  • In physics game you can create an invisible solid circle, pin it to the object and it will push other objects away.

    Without physics you can do something like this:

  • You tell me!

    What is your next problem?

  • Make a sprite with X icon. Create/spawn this sprite when you need it, then destroy.

    You can add a fade behavior, it will destroy the sprite for you after fading out.

    Alternatively you can keep this sprite invisible and toggle its visibility.

    Or keep it off the screen and move it to the screen when you need to display it.

  • Check collision polygons and origin image points of your sprite. Ideally the collision polygon and origin image point should be the same for all frames/animations.

    Incorrectly positioned image point on a single frame could trigger unexpected falling/jumping/collision events.

  • The only way to do this is to add an instance variable "type" to the family. Set type="A" for sprites A, type="B" for sprites B etc.

    Then you will be able to pick family members by type and loop through them.

  • What do you mean "no longer working"?

    Tokencount works and you can use it to validate email address format, but you need to create several conditions:

    tokencount(emailText, "@")=1

    tokencount(emailText, ".")>0

    tokencount(emailText, ",")=0

    tokencount(emailText, " ")=0

    etc.

    Those are some basic checks, if you need a more strict validation, you can create a string of all characters that are not allowed in email and do something like this:

    charList="`:;'<>,/?\"   <-- this is just an example, not the actual list of restricted characters
    For x=0 to len(charList)-1
       tokencount(emailText, mid(charList,loopindex,1))=0
    [/code:1sinvf5u]
  • First line determines zoom level - from 1.4 for stationary (zoomed in), down to 1 when player's speed is equal to layoutWidth (zoom 100%).

    If the player is moving even faster, zoom can become <1. I didn't want that, so I added zoom=max(zoom,1)

    I don't like this zoom effect either, you should definitely play with the values or camera speed etc.

  • Yeah, you need to be careful with the void

    Frankly, this is the first time I'm playing with smooth zooming/scrolling. I should add something like this to my game.