Yann's Recent Forum Activity

  • I wouldn't use a super big image for collision but build the collision out of a little resized square. This way you only load a little texture and you get a good level of customisation directly inside C2

  • I prefer using instance variable. It greatly helps with picking and is way more readable than simple array indexes. Also it's more in the logic of OOP.

    To keep these data through layouts, I would make the object global.

    To save/retrieve these data with webstorage or server database it could be interesting to have an action for serializing/unserializing these data into an XML or whatever string easily saveable.

    Ashley has some ideas maybe.

  • healthBar.capx

  • a bit simpler healthState.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Be carefull only the origin point snaps to the grid

    If the origin point of your sprite is in the middle it will snap by the middle

    I often put the origin point at top-left for snapping

  • Noga your formula is overcomplicated

    First using the same angle order as c2 (0 is to the right and then you move clockwise) makes the formula way easier.

    You can sum it up as round(animationFramCount*angle/360) but as you well representated in your image you need to offset the angle a bit so the direction the sprite shows represents the center of the range of angle and not the minimum.

    So it should look like

    ceil(animationFrameCount*angle/360-0.5)

    Then to avoid negative result (for angle from 0 to 180/animationFramCount),

    you just have to offset values and modulo them

    ceil(animationFrameCount*(1+angle/360)-0.5)%animationFrameCount
  • If I remember correctly, multimedia fusion 2 has two kind of "or". An or "logical" and an or "filtered".

    Even with the experience I have with mmf2, cc and c2, I think I really understand this design choice now (well I dropped mmf2 long ago...)

    Anyway, if it's that hard to understand, it's probably not a good choice.

    So, I don't think having a logical and filtered else would be a good idea...

  • Ashley :D yeah I saw my mistake and thought about something else as a solution

    So I reposted it with some changes

  • I honestly think that "else" shouldn't mess with picking as most system expression.

    In my opinion, else is missing in c2 for only one algorithmic case: "when my previous condition is false"

    Putting the inverted condition as an else doesn't work if the action of the previous condition makes the next one true (like Ashley's toggling example)

    In short, I side with Geo in the idea of keeping the else logical only.

    Also in Ashley's case 2 things can be easily handled by just inverting condition

    +Sprite: X < 320
      -> Sprite: set opacity to 33
    +Sprite: X >= 320 
      -> Sprite: set opacity to 100

    There's really no need for an else here

    If we keep telling users that "most system conditions do not pick any instances: they are either true or false." It will be the same rule applied to "else"

    The only system expression that should modify picking should be those in the "Pick instances" category and the for each loop. Because they are pretty self explanatory.

    Unless someone find a good situation where inverting picking is really that usefull and can't be handled by just inverting events... I don't think it's worth it.

    hmm let see a case were inverting a condition doesn't work

    +Sprite: X < 320
      -> set X to 400
    +Sprite: X >= 320
      -> set X to 100

    Obviously all sprite will go to X = 100

    we need an else here

    +Sprite: X < 320
      -> set X to 400
    +Else
      -> set X to 100

    Indeed if this else is a logical one, and there's even just one sprite at X < 320 the others won't go to X=100 as the else won't be executed

    One of the work around could be to loop through objects

    +Foreach sprite:
      +Sprite: X < 320
        -> set X to 400
      +Else
        -> set X to 100

    Which makes me thing that we also need to loop some other different case where we use system expression on instances, like distances or angle checks

    +Foreach sprite
      // check for sprite too far from the center of the view
      System: distance(scrollX,scrollY,Sprite.X,Sprite.Y) > 100
        -> do things

    So it's not far from it actually.

    However, if I'm not wrong about how event works, condition "inside objects" works does a kind of hidden loops.

    Like

    +Sprite: Y > LayoutHeight
      -> Sprite:destroy

    Which leads me to this idea: maybe we could have a system else for logical purpose and an instance "inverse picking"

    Then the aformentionned problem would be reduced to

    +Sprite: X < 320
      -> set X to 400
    +Sprite:invert picking
      -> set X to 100

    (of course you'd have to have a link system between two events...)

    ... This way you keep the two ideas, as well has clarity =)

    Annnnd I side with Arima on that one, didn't read his posts but we had the same ideas (:

  • if I understand correctly you have 2 components :

    • shooting direction
    • wind force

    if it's correct, I think you should do something like

    on Shot
      -> Ball apply impulse  shotStrength   at angle angle(ball.x,ball.y,directionOfShoot.x,directionOfShoot.y)

    and for the wind

    Every ticks
      -> Ball apply force windStrength at angle windAngle

    shotStrength, windStrength and windAngle are values you have to figure out.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann