AllanR's Forum Posts

  • So, I have finally started playing around with the multiplayer plugin - because my son has been pestering me to help him for months. I have been telling him to work on learning the basics of C2, and that multiplayer is too complex for him. But he is getting to the point where he is ready to give it a try, so that means I have to know how it works too...

    So far things are going great! Having the Real-time multiplayer template has been a life saver.

    One place where we are having a little issue is on customizing the peer character. He wants to have players choose a few options for their character before they join the game.

    We have the Host create the default character, then the peer sends the chosen options in a message to the host. The host updates the peer object (which then syncs out to all the players). That looks a little funny because you see the default object for a couple ticks before it snaps to the right character when ever a new peer joins. We got around that problem by creating new peers invisible until the host gets the options and sets a flag saying it is ok to make the new peer visible.

    It would be a lot easier if you could pass parameters in the Multiplayer Login action (the way you pass parameters to a function). That way, when the host gets the On Peer Connected event it would be able to set up the peer object correctly without all the hassle.

  • Very nice!

  • Seems to work fine for me (all of the red falls - and seems to splash!)... Awesome job ROJOjound! : )

    I was getting a solid 60 frames a second, although the sand still seemed to fall at about half the speed that gravity would normally make it drop. Also, when sand was flowing over both sides of the white line sand was settling between the lines higher than outside the streams of falling sand - so that didn't look completely natural. But it certainly is a great start - especially since you couldn't see it run!

  • jeffige

    you can easily do it either way...

    with animations, create the object, and then Set Animation to: Choose("red", "blue", "green", "yellow")

    (assuming those are the names of the animations obviously)

    if you put 4 different objects in a family, then Create family object will randomly choose one of the types for you.

    So, if the objects are vastly different from each other - with lots of different properties, then the family way is easier.

    But it they are mostly the same, except for the animation, then that way works fine too.

  • trueicecold

    at the start of layout, set scroll.X and scroll.Y to the bottom.

    or give your player the scrollTo behavior, and place him at the bottom - then the layout will scroll to his position.

  • Andersonfrfilho

    in an action after you call function MMC, you get set a variable to Function.ReturnValue

    or use Function.ReturnValue in an expression

  • Ruskul newt

    Nice! thanks for finding that article. That's awesome and works really well.

    I tried it out in the original capx, you can see my version with the solution above here: http://www.rieperts.com/games/forum/TestsJitterDemonstration.capx

  • lovjc7

    it would help to have a test capx file to look at, otherwise you are only going to get vague suggestions...

    but what you want to do is "scale" the speed to a range of playback rates.

    so, in the Set Playback Rate action, you would set Playback rate to:

    1.0 * car.Platform.Speed / car.Platform.MaxSpeed

    obviously, that is assuming you are using the Platform behavior. Also, you would have to find what range of rates sound good with the sound effect you are using - what would be the minimum rate and what would be the maximum.

    if the minimum rate you want is 0.5 and the maximum is 1.4, then you would need to set the rate to:

    0.5 + 0.9 * Sprite2.Platform.Speed / Sprite2.Platform.MaxSpeed

    or as a general function: set playback rate to: min rate + (max rate - min rate) x current car speed / max car speed

    you might want to adjust the volume of the engine sound by scaling it in a similar way...

  • jeffige

    either you have to test if it has reached 100% in the every tick event (before you change the size)

    system > every tick: logo > set size to (self.width + 16 * 0.5, selfheight + 9 * 0.5)

    would become:

    system > every tick: logo.width less than (target width) > logo: set size to (self.width + 16 * 0.5, selfheight + 9 * 0.5)

    or you could use LiteTween: https://www.scirra.com/forum/behavior-litetween_t70700

    the nice thing about litetween is that it has many different ease in and out effects. you can also tween different properties at the same time: size, position, opacity, etc...

  • tunepunk

    ok, now I see what you are trying to do.

    But, to do a normal run cycle you can't do the entire cycle in one bounce - it takes two bounces to get back to the starting point of the cycle (the legs pass each other only once per bounce).

    If you watch the video in your link in Chrome, you can set the speed to 0.25 to slow it down - you will see that the legs are fully extended at the top of the bounce. They only cross at the bottom when one foot is on the ground. It alternates between the left and right foot on each bounce.

    So, you will need another variable (maybe called "Foot") that alternates at the end of each bounce (every time the progression gets down to zero).

    You can still probably do it with 4 frames - but it will have to be spread over two bounces.

  • tunepunk

    in addition to the "Progression" instance variable. have an "Addition" instance variable.

    so, I guess Progression would start at zero, and Addition at 1 (or however much you were adding each tick.

    If Progression >= 180 then multiply Addition by -1

    if Progression <= 0 then multiply Addition by -1 again.

    Every tick set Progression to Progression + Addition.

    If you need to speed up the bounce, just make Addition a bigger number...

    ok, after thinking about this for another minute, I was thinking that the bounce animation might look un-natural playing backward - The object would appear to start to be squished before it hits the ground. You may want to have two animations - one for the way down, and one for the way up. So, when you are calculating what frame of the animation to show (based on Progression), could would also know which animation to use based on testing if Addition is positive or negative.

  • Emac

    the swipe2.capx file has a HUD layer (with nothing on it). To make that layer stay on screen all the time, set its parallax settings to 0,0

    then you can add a tab with icons on that layer and they will stay put. (put the tab on the left side of the layout - otherwise it probably wont be on-screen)

    No, I don't have any way for people to donate, but thanks for the offer! Most of what I have learned about C2 is from helping people in the forums solve problems - so it is already a win/win situation...

  • are you wanting shadows? (sounds like a Plato story I heard a long time ago)...

    there was a tutorial not long ago that had some pretty cool lighting effects. It includes torches that you see, but I bet it would help give you a place to start...

    https://www.scirra.com/tutorials/5363/basic-but-epic-2d-lighting

  • looks like event 21 is in the right place to me.

    I would check to make sure you actually have the "crawl"&self.a animations named correctly - if the name of the animations inside the sprite does not match, then it can't play it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Alexiss169

    you could add an instance variable called "State" to your player and use that as a prefix (or suffix) for the animation names...

    so you would have "idleNormal", "walkNormal", "attackNormal", etc...

    or "idleAwakening", "walkAwakening", "attackAwakening", etc...

    then any time you change the animation, just include the state variable:

    Set Player animation to "idle" & Player.State

    (obviously you would set State = "Normal" at the start, and then = "Awakening" as needed - you could have any number of other stages).