Yann's Recent Forum Activity

  • Velojet avatar from tastybytes (:

  • I don't understand your problem

    seems pretty fine here

    shipShooter.capx

    here I made the ship volontarily shot at 90 degree to test the "bullet should follow the ship"

    And even if you have the weird impression it goes sideway, if you think horizontally it follow the ship quite well.

    ship90degreeShooter.capx

    The impression you have that the bullet doesn't follow, might be caused by the fact that you are accelerating. Your bullet just get the instant velocity the moment you shoot. You can see that in the second capx, when you attain maxSpeed, bullets follow the ship. But when you change direction and your velocity is not constant anymore, the bullet doesn't follow anymore.

    That's an expected behavior

  • Bob Thulfram

    What do you mean by overshoot a corner when moving? You overlap a wall? If you do I'd like to see a screenshot 'cause in my mind that's pretty unlikely.

    Also what do you mean by "360 degree vector with angles" ?

    This example works by first moving a detector in the direction given by th input key. The cos and sin gives the proper direction to multiply by the length of the cell. (event 5)

    And if the detector doesn't overlap a wall, the move is checked we can initiate it(event 6 does the opposite)

    The move itself works by adding a little bit each tick. dt ensure that this little bit is always proportionnal to the time between two frame, thus making it frame rate independant (event7)

    The only problem is that it's not a whole number. But we have to stop the movement after 32 px exactly, so once I cross the number I just substract the difference to get 32px exactly (event8)

  • Keyboard: A is down

    Keyboard: D is down

    Keyboard: On W pressed

    There's a nuance (:

  • imothep85 looks like he tested some of the last release of mmf2 and indeed they have a cool feature. You can display sprites on top of a video object (ActiveDirectShow if I remember)

    I actually used that to help a friend with her game http://vimeo.com/25798545

    This way all the camera angle of this point&click were in some video sequence (instead of heavy animated sprites) that looped and you could overlay sprites and UI on top of it.

    So yeah it could be a nice addition for c2 but I don't think video support is that advanced yet for HTML5... Don't know (:

  • Seriously guys, don't be that focused on screening cheaters.

    The aim of this contest is to promote C2 and make it known by other communities (while giving some gift to the best)

    Having the free version as limitation will be like "look at what you can already do with only the free version. Now imagine what you could do with the standard illimited version"

    Those who know me know that I'm kind of a technician with C2 and that I can make some convoluted stuff with the tool like pseudo 3D or gravity stuff.

    But technic DOESN'T make good games. It helps a lot, but first you need to be a good designer (that's what I'm lacking (: )

    I can tell you that you can make MoonShield and probably most of Airscape's mecanisms in less than 100 events.

    Cubemaze is 483 events but Moonshield and Airscape are way better.

    So yeah more than 100 events won't necesseraly make a better game. The simpler the better. Try to keep the 100 events limitation and work around that, you might even make something better.

    Help C2 be known and show that the C2 community is fair. It's should be more than enough.

    As far as I'm concerned I won't participate. I have too much project in my mind. But, I will help anybody that needs it (and ask politely :D). You can also ask me by pm if you want to keep your project secret. But I prefer when answers are shared.

    Good luck every one and make good games (: .

  • you can use

    distance(0,0,player_ship.Physics.VelocityX,player_ship.Physics.VelocityY)

    it's the same (well ok there's no much gain in term of place on that one)

    For your bullet if it's a bullet behavior you have to give the angle of movement and the speed if I remember so it would be

    angle of the object = angle of the ship

    bullet.movingangle = angle(vector Velocity of the bullet + vector velocity of the ship)

    bullet.speed = magnitude(vector Velocity of the bullet + vector Velocity of the ship)

    In short you have to add the two vector and then retrieve the angle and speed of the solution

    To add the two vector do it this way :

    Global number bulletSpeed = 500 //put what you want
    +On shot
      Local number bVx = 0  //bullet X component of default velocity vector
      Local number bVy = 0  //bullet Y component of default velocity vector
      Local number sVx = 0  //ship X component of velocity vector
      Local number sVy = 0  //ship Y component of velocity vector
      Local number rVx = 0  //result X component of velocity vector
      Local number rVy = 0  //result Y component of velocity vector
      player_ship: Spawn projectile
      System: set bVx to cos(player_ship.angle)*bulletSpeed
      System: set bVy to sin(player_ship.angle)*bulletSpeed
      System: set sVx to player_ship.Physics.VelocityX
      System: set sVy to player_ship.Physics.VelocityY
      System: set rVx to bVx + sVx
      System: set rVy to bVx + sVy
      Projectile: set angle to player_ship.angle
    // if your bullet is just a physic object you can set it's velocity X and Y to rVx and rVy... For bullet behavior you need two more steps
      Projectile: Bullet set moving Angle to angle(0,0,rVx,rVy)
      Projectile: Bullet set speed to distance(0,0,rVx,rVy)

    Tell me if it worked, not sure.

  • dialogTree.capx

    and tuto... hmpf... I'll see

  • masking.capx

  • Nobody is responding probably because nobody wanted to dive into your heavy code. It's not super easy.

    Now than I read it a bit, I know that you're not doing it the right way if you want to repeat stuff over and over with more text content.

    When you see yourself copying stuff many times to achieve the same kind of display, you should try to find what is common and how to only change what is not.

    The things that are common are :

    • a text with a question in it
    • two possible clickable answers Or a clickable "Next"

    In short we can say that the Next is like an answer because in both case you will display the next text

    So basically you need 3 text object.

    You can either make them 3 instance with an instance variable 'type' to tell them apart (type = "question", type="answer1", type = "anwser2")

    Or

    Use 3 different object and group them in a family 'dialog'

    This way you can make the 3 object appear at the same time and avoid most of the repeated "set visible" lines

    Then the only thing you have to care about is how to grab the proper string and put it in the proper text object

    That's where it's complicated. If you have a dialog tree like :

    Question0
      -> answer 0  
        -> Question 1
          -> answer 2                    
            -> Question 3
              -> answer 6
                -> [END OF CONVERSATION]
              -> answer 7
                -> [END OF CONVERSATION]
          -> answer 3
              -> [END OF CONVERSATION]
      -> answer 1
        -> Question 2
          -> answer 4
              -> [END OF CONVERSATION]
          -> answer 5
              -> [END OF CONVERSATION]

    You will need to structure your data in a way that associate each question with its possible answer and each possible answer to the possible next question or end of converstation.

    One way to do it is to have two variable, one for question and one for answers

    Global text questions = ""
    Global text qnswers = ""
    +System: on start of layout
      -> System: set questions to "Question0|0|1
    Question2|2|3
    Question3|4|5
    Question4|6|7"
      -> System: set answers to "answer0|1
    answer1|2
    answer2|3
    answer3|end
    answer4|end
    answer5|end
    answer6|end
    answer7|end"

    And then use another global variable to know which question and then which answer to display (I will use the "all text object are instances with variable type to tell them apart" aforementionned option)

    You'll also need a 'nextQ' instance variable (type text) for the text object answer. We will store the next question information in it

    Global number Qi = 0          //index of the current question
    Global text curA=""           //list of current possible answer
    System:Qi > 0
      Text: type = "question"
        Local text Q = ""         //line which hold the question and its possible answer's index
        -> System: set Q to tokenat(questions,Qi,newline)
        -> Text: set text to tokenat(Q,0,"|")
        -> System: set curA to replace(Q,Text.text&"|","")
      System: for "" from 0 to tokenCount(curA,"|")-1
      Text: type = "answer"&loopindex+1
        Local number Ai = 0        //current answer index
        Local text A = ""          //line which hold the answer and its associated next question
        -> System: set Ai to int(tokenat(curA,loopindex,"|")
        -> System: set A to tokenat(answers,Ai,newline)
        -> Text: set text to tokenat(A,0,"|")
        -> Text: set nextQ = tokenat(A,1,"|")
    Mouse: On click on Text
    Text: nextQ not equal to ""
      -> set Qi to int(Text.nextQ)
      Text:nextQ equal "end"
        -> set Qi to -1

    Should work.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • angle(0,0,Ball.Physics.VelocityX,Ball.Physics.VelocityY)

    gives you the angle of the movement

    dunno if there's an expression for that now

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann