Yann's Forum Posts

  • place, stretch and angle some basic square sprite to surround all your tubes path

    And set them to be invisible

  • You need a parenting system.

    Basically for your 'lvlSprite' (sprite representing the levels), you create 2 instance variable

    'ID' and 'parentID'

    Then at edit time you set each variable logically.

    • 'ID' can be the number of the level (1-based)
    • 'parentID' should be the ID of the level you have to clear to be able to play this one. 0 for the first level. (this system won't support multiple parent, just simple branching)

    And then you'd just have to know which levels are cleared

    (damn bit masking would make all that so much easier... there's a bit plugin by the way... but the concept might seem a lil bit complicated even if it's not. And also custom plugins aren't arcade-compatible)

    Anyway storing cleared level is the hardest part. I would use a global text with the list of cleared levels

    Global text clearedLVL = ":0:"
    Global number lvlID = 0
    System: On start of layout
      -> lock: destroy
      System: foreach lvlSprite
      System: find(":"&lvlSprite.parentID&":") = -1
        -> lvlSprite: spawn lock

    And when you enter a level

    Mouse: on left click on lvlSprite
    [invert]Mouse: is over lock
      -> set lvlID to lvlSprite.ID
      -> go to layout (by name) "level"&lvlID

    And when you clear a level

    On level cleared
      -> set clearedLVL to clearedLVL&":"&lvlID&":"

    This way you'll build a string of level that will look like

    ":0::1::2::5::6:"

    We have that kind of separation to avoid problem with the find() function.

    That's all

  • Sprite: set X to turret.X+cos(turret.angle)*distance(turret.x,turret.y,mouse.x,mouse.y)
    Sprite: set Y to turret.Y+sin(turret.angle)*distance(turret.x,turret.y,mouse.x,mouse.y)
  • klaypigeon >

    When you create a sprite, and you put the bullet behavior on it, in the property panel you have some properties for the behavior, one is "speed".

    If you have only one instance and you set a speed it will be kept as a template for runtime created bullets.

  • Global number t = 0  //evolution of interpolation (from 0 to 1)
    Global number startY = -20 //vertical start position of movement
    Global number enY = 300    //vertical end position of movement
    Global number speed = 100  //average speed in px per second
    System:Every tick
      -> System: set t to min(t+dt*speed/Abs(endY-startY),1)[/code:11ceqqut]
    And then
    For a linear movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t)[/code:11ceqqut]
    For an eased-out movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t^2)[/code:11ceqqut]
    For an eased-in movement you use
    [code:11ceqqut]System: Every tick
      -> Sprite: set Y to lerp(startY,endY,t^0.5)[/code:11ceqqut]
  • rename my capx into a .zip and open the caproj file to change the version

    and then revert it back to a .capx.

    I don't use any new stuff that should work.

  • If you don't use the foreach, the distance check will be with the first instance of the Door. So for the second the check will return false and then the text will never appear.

    So yeah you'll need the foreach if you have more than one door even if the associated action is the same.

    You're welcome.

  • There's a plugin for that

  • There's several issues with your capx :

    1/ you can't really know if the event is working, because your text is way out of screen at (70,446) when your character (an then the scrolling) is at about (880,3200). So you need to put your text and text_box in another layer with 0,0 parallaxe

    2/ 10px is too short, your the distance between the hotspot of your character and it's boundaries are already greater than 10px.

    I put < 60 instead

    3/ the system distance() function doesn't do any picking. If you know you'll have only one closed door in all your layout it's ok. But if you want to put more than one, you have to filter each closed door with a foreach and do the distance check afterward.

    Look at the capx. the order of event 23's conditions is important:

    • first filter closed door
    • next take each closed door one by one
    • and then do the distance check on the door the foreach is on

    doorPicking.capx

  • That's not a bug.

    That's the difference between a Trigger and a non-Trigger event.

    Trigger event (those with the green arrow on the left) are events outside the game loop. They are usually triggered before the next game loop to respond fast to the player input.

    The order of event is kept inside triggers though.

    if you do a

    Keyboard: On any key pressed
    [ul]
    	[li]> set Right_Pressed to 0[/li]
    [/ul]Keyboard: On Right arrow pressed
    [ul]
    	[li]> set Right_Pressed to 1[/li]
    [/ul]Keyboard: On any key pressed
    Right_Pressed = 1
    [ul]
    	[li]> Play sound[/li]
    	[li]> set Right_Pressed to 0

    The sound will play

    Keyboard: On any key pressed
    [ul]
    	[li]> set Right_Pressed to 0[/li]
    [/ul]Keyboard: On any key pressed
    Right_Pressed = 1
    [ul]
    	[li]> Play sound[/li]
    	[li]> set Right_Pressed to 0[/li]
    [/ul]Keyboard: On Right arrow pressed
    [ul]
    	[li]> set Right_Pressed to 1

    The sound won't be played

    Also notice that in your capx, if you put event 12 as the first event, you'll hear the sound.

    And for the number not displaying as you expect. The trigger is "On Up arrow pressed" that means that this event will play the instant you press the Up arrow, not before, not after. Then your Every tick that reset these variables will prevail.

  • MovObj_PF_r75.a.capx

    MovObj_PF_withPreview_r75.a.capx

    Hop! little logic debug. Some of my old decision made the sprite jump directly from the first to the second case. In step mode it wasn't an issue but in smooth mode if you moved by just one cell there wasn't any interpolation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Oh you mean something like that?

    gridMovement.capx

  • If you can do part of the animation directly by event its better.

    Else you can maybe split stuff, like if you have a constant background you can just render what moves and put it on top.

    Well it basically depends on how your animation is made of course.

  • First, I don't want to sound pessimistic, but making a 2D fighting game is super hard, there's a lot of timing issues to do right and I don't talk about animation.

    That said, making the computer adapt to your playing style. Hmmm how could this be done?

    What is a playing style? A sequence of input that appears more often than other?

    Maybe we don't need to go that far as to register input sequences but then register the prefered moves?

    If we tackle the question from another angle, what is a good fighting game player? In my opinion it's a matter of timing. Doing the proper attack at the proper time, or doing the proper defense or counter.

    So let say you managed to register the moves and you have a graph of what moves appear most often. What should the computer do?

    When the player launch an attack doing a weighted random picking on possible defense or counter moves ?

    And then when the computer choose (?) to attack, he will do a weighted random picking on each possible attack based on the defenses or counter the player does rarely ?

    Ok why not. On the paper that seems doable. Now what kind of game would it be. It would be a game where, if you vary your attack the most you have better chances to win?

    So the player will have to memorise what attack he already used and use others to keep the weighted random balance the more even possible. Or maybe volontarily making the same move over and over to the risk of being heavily countered and then switch to something else?

    I wonder if it would be that fun. Maybe yes. Anyway, I'm really curious to see the result. I'm interested in IA adaptation so I hope you'll succeed (:

  • your [invert] collision = 1 isn't inside the loop so yeah you are running the full iterations congrats :D

    Also [invert] collision = 1 is the same as collision not equal to 1... there's the operator... Well as it's the same it's not an issue, just wonder what is better practice.