R0J0hound's Forum Posts

  • Here are two ways to check if two sprites have the same x and y positions:

    + System: Always (every tick)
    -> Sprite: Set collision mode to Point
    -> Sprite2: Set collision mode to Point
    
    + Sprite: Sprite overlaps Sprite2
    -> Do Actions
    
    + System: Always (every tick)
    -> Sprite: Set collision mode to Per Pixel
    -> Sprite2: Set collision mode to Per Pixel[/code:1y35dq1p]
    [code:1y35dq1p]+ System: For each Sprite2
    + Sprite: X Equal to Sprite2.X
    + Sprite: Y Equal to Sprite2.Y
    -> Do Actions[/code:1y35dq1p]
    
    Keep in mind thought that positions in construct are floating point, so objects will almost never be at the exact same location.  But if you want to compare x,y location I'd recommend comparing the distance between the two objects and consider it a collision if they are close enough.
    
    Ex:
    [code:1y35dq1p]+ System: For each Sprite2
    + Sprite: Pick by distance(Sprite.X, Sprite.Y, Sprite2.X, Sprite2.Y) Lower or equal 10
    -> Do Actions[/code:1y35dq1p]
  • Add a "Trigger Once" condition to the global variable comparison events so the actions a done only once when true. As it is now, every tick sets the animation so the the multiframe animation don't get a chance to play.

  • You can make chess in construct, but it will take some doing to make a computer player.

    Here are some helpful websites on the subject:

    http://chessprogramming.wikispaces.com/

    http://www.gamedev.net/reference/programming/features/chess1/

    Here is an initial stage of a checkers game I was making (not the same as chess I know, but similar). It allows movement of any piece, capturing of the other colors piece, and kinging. I didn't go any further, because it would become very complex making a smart enough computer ai to make it enjoyable to play. Complexities aside, I find checkers more enjoyable to play against a human player.

    http://dl.dropbox.com/u/5426011/examples/checkers3.cap

  • What newt said and the formula used with sprite2 didn't need the "/10".

    It sould look like this:

    -> Sprite: Set animation frame to (Sprite4.Value('DamageValue')%100)/10+1
    -> Sprite2: Set animation frame to (Sprite4.Value('DamageValue')%10)+1[/code:pudjgm3v]
  • I attempted to recreate the problem with the details you provided. Don't use the OR condition. While OR works well enough in most cases, it's what is causing the crashes in your case. Not sure about the other problems. More details are needed, or a cap would be nice.

  • The idea is easily changed for families. Simply use a family instead of "Sprite".

  • Just make all the buttons not highlighted, then only highlight to current button.

    Like this:

    + System: Always (every tick)
    -> Sprite: Set filter to white
    + MouseKeyboard: Mouse is over Sprite
    -> Sprite: Set filter to Blue[/code:3dc9fgtv]
  • It seems to work here, or is the problem that the player stops short of the obstacle?

  • In your example only the last sprite is getting colored because only the most recently created sprite gets picked. So the trick is to assign a color filter as the sprites are created.

    Here are two different ways to do it:

    + Button: On Button clicked
    -> System: Create object Sprite on layer 1 at (100, 100)
    -> Sprite: Set filter to cyan
    -> System: Create object Sprite on layer 1 at (250, 100)
    -> Sprite: Set filter to cyan
    -> System: Create object Sprite on layer 1 at (400, 100)
    -> Sprite: Set filter to cyan
    [/code:3bh1xu44]
    [code:3bh1xu44]+ Button: On Button clicked
    + System: For "" from 1 to 3
    -> System: Create object Sprite on layer 1 at ({100, 250, 400}@LoopIndex, 100)
    -> Sprite: Set filter to cyan[/code:3bh1xu44]
  • lucid the slowdown is due to a fix I submitted (SVN revision 153) for a bug where the collision mask did not change when the frame changed with animated sprites. The fix was first in construct 0.99.85.

    Here's the tracker:http://sourceforge.net/tracker/?func=detail&aid=2974232&group_id=207820&atid=1003219

    My fix was to recalculate the collision mask every time the frame changed. Before, the collision mask would only be recalculated when a sprite's size or rotation changed.

    If you uncheck "loop" or set "animation speed" to zero for the animations that are only one frame your fps should go back close to what it was.

  • http://dl.dropbox.com/u/5426011/examples/doubleattack.cap

    req 0.99.9

    or in pseudo code:

    + MouseKeyboard: On key Enter pressed
      + Anakin: Animation "Lightsaber1" is playing
        -> Anakin: Set 'attackAgain' to 1
      + System: Else
      + Anakin: [negated] Anakin: Animation "Lightsaber2" is playing
        -> Anakin: Set animation to "Lightsaber1"
    + Anakin: Animation "Lightsaber2" finished
      -> Anakin: Set animation to "Idle"
    + Anakin: Animation "Lightsaber1" finished
      + Anakin: Value 'attackAgain' Equal to 1
        -> Anakin: Set animation to "Lightsaber2"
        -> Anakin: Set 'attackAgain' to 0
      + System: Else
        -> Anakin: Set animation to "Idle"[/code:2nhaxrna]
    
    If that isn't what you were looking for let me know.
  • [quote:2f63x61e]Is family picking "bug" here again?

    This bug? http://sourceforge.net/tracker/?func=detail&aid=3023008&group_id=207820&atid=1003219

    or are you talking about another bug?

    lucid, is that fps slowdown only in this version? What version of construct were/are you using for the better fps?

  • Just use the private variable condition "pick with lowest value".

    so your event would look like this:

    + Bullets: On collision between Bullets and Bullets
    + Bullets: Pick with lowest ''Power''
    -> Sprite: Destroy
    [/code:1ngnyzu7]
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Very cool!