vee41's Recent Forum Activity

  • On pipe created

    .. random(100) < pipe.spawn

    ... spawn the plant

    ... print the good text

    .. else

    ... print the bad text

    Should work :)

  • Here is an example that uses technique a little bit like the solution I mentioned before:

    Animation stuff

  • I edited the above example a bit, might be a bit more what you are after.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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?

vee41's avatar

vee41

Member since 12 Apr, 2012

None one is following vee41 yet!

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies