vee41's Forum Posts

  • It's all around coming up with ways to just tell Construct 2 to play a looping animation for a set amount of time and then do something.

    You could achieve this pretty easily with timer variable of your own.

    Create instance variables idleDuration and animationTimer for your sprite.

    Then do events something like this:

    every tick

    ..add dt to sprite.animationTimer

    on animation 'Idle' started

    .. set animationTimer to 0

    animationTimer > idleDuration

    .. animation 'Idle' is playing

    .... do the stuff you want to do at the end of your idle animation

  • > Try something like this

    >

    > On melee attack hit

    > .. set enemy animation frame to enemy.animationframe+1

    so i've tried that and it doesn't seem to work. what i have going is the enemy has a walking animation that stops when the player gets close (event:Sprite-->Platform On Stopped-->action:Sprite-->Stop animation

                                       -->action:Sprite-->Set anim. frame to 4)

    after he stops, i want the player to hit him three times with each hit advancing one frame of animation to show the damage he's taken.

    i've named the damage animation 'collapse' so i tried this:

    (action:Sprite-->Set frame to (Sprite.Collapse.frame+1)%Sprite.Collapse.Animationframecount)

    but that doesn't seem to work. not that i know why it would, i don't really know what i'm doing obviously. haha.

    thanks anyway for your help.           

    Here's an example:

    Enemy collision stuff

  • Try something like this

    On melee attack hit

    .. set enemy animation frame to enemy.animationframe+1

  • The whole loop is executed in one tick, you can use search to find some discussions about it :)

    After the wait event the loop is not really executing anymore, so you cannot refer to loopIndex anymore. You could do it like this:

    variable = 0

    for 0 .. 10

    .. wait loopIndex seconds

    .. add 1 to variable

    .. set text

    Why not use 'every 1 seconds' event to set your text rather than a loop?

  • Hi, im creating a object inside the layout boundaries and using a random generator. Every 0 to 3 seconds i create one of these sprites. actually some sprites are created at the same spot that others.

    but i want that each object created do not be created over another existing sprite. there's a way to guess where the other actors are in the moment of creation and set some distance from the already created actors?

    tks

    Here is an example that does something similar, none of the sprites at the start are allowed to spawn on top of each other.

    Evil sprites demo

  • Anyone else? This is about adding a random rgb value to an already existing array and tint the object...

    I'd probably generate string with rgb values: round(random(0,200)) & ";"& round(random(0,200)) & ";" & round(random(0,200)). Then, you can save that to your array and fetch the proper values with tokenat() - expression.

  • there's a whole level loading algorithm behind and this feature depends on the algorithm ...

    Just do a lot of debug texts, check for variable values at every point and see where the flaw in logic is. In theory it should work, you can set variables inside a loop after creating an object. What you cannot do is refer to it before next top level event.

  • It would seem to me that since we have successfully tied the number of touches to the "Level" global variable then we could use the current number of touches (the result of whatever positive or negative numbers are generated through Forward or Reverse clicks) to a given sum and use that number as a method for defining which layout to load.

    For example: If the player clicks forward button twice and the reverse once they would find themselves at the start frame of "animation2"...or from a value standpoint that would be +1 +1 -1 in the touches variable which would result in a +1 total number of touches (1+1-1=1). Maybe I am thinking about this all wrong but it seems that would allow me to essentially assign each animation a static touches value and that I could use that to direct a player to a specific layout. Am I heading in the right direction with this?

    That would be correct way to think it, the touches variable represents the selected animation, which represents certain level. So you could add 'launch' button, or perhaps click on sprite event, that would start a certain layout depending on the touches variable.

  • At awesome balls (link at signature) I simply did

    'on block created'

    .. set tint variables to random color

    Why do you need the array, you plan to save the colors for later use?

  • Maybe a RGB Slider? (One for each)

    Though I have no idea how to make sliders...

    I don't believe there is inbuilt functionality for sliders / color wheel. So you'd need to implement one yourself, and tie the functionality to the player choices.

    Look into canvas plugin though, it usually solves everything graphics related. :)

  • Maybe just an error message that displays if the function doesn't exist ...

    If I recall correctly, at least chrome console displays an error message.

  • There is webgl effect you can use to change color dynamically in game. Either tint or color, whatever fits your purpose better :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Very cool...I had to make one slight adjustment to the global variable (from 3 to 4) as when it was set to 3 it wouldn't actually play animation3 prior to halting the forward animations. If I am understanding this correctly...if I were to add animations to the sprite object I would simply increase the global variable a corresponding number of times.

    Does that sound about right?

    That is correct. Sent you pm by the way :)

  • I updated the link I posted earlier, there is now simple comparison to check that touches variable stays within amount of levels in the game. Hope this helps. :)

  • Remove wait 0, it should work. I'd guess your problem is somewhere else.