Ajbael's Forum Posts

  • You can move left/right by holding a/d keys to make the walk animation play.

    https://drive.google.com/open?id=1iB4HO ... JTvypGlA82

    I'm not exactly sure what is going wrong, the animation loops seamlessly in Spriter. Whenever it plays in game it looks to be starting half way through the cycle every time it loops. It's probably something simple, but I haven't been able to find anything online about it.

  • dop2000

    R0J0hound

    Thank you both, this is a big help!

  • Eh, I'm no Yoda but here is a way to do tweening:

    http://dl.dropbox.com/u/5426011/examples%208/tween.capx

    http://dl.dropbox.com/u/5426011/example ... imple.capx

    http://dl.dropbox.com/u/5426011/example ... 2011-12-28 06:34:51

    The links 404'd, but I could really benefit from them. Could you reload them?

  • Actually, I just plugged the code into the game I'm working on and it runs flawlessly. I'm baffled, definitely inspired to learn as much as I can about arrays.

  • R0J0hound

    Absolutely amazing. Should be a snap to build my own version of this as soon as I learn arrays!

  • R0J0hound

    Perfect, thanks!

  • R0J0hound

    Is it possible to achieve smooth transitions like you have demonstrated if the player character has physics applied to it?

    I'm working on a different approach to cylindrical world maps where if the players goes beyond X:5000 their X is set to 100. It works perfectly except obviously when this happens they loose their X.Y and Angular Velocities.

    I have it setup so that these velocities are recorded when they hit X:5000 and reapplied when they hit X:100 but there is a "hiccup" where the player character is froze for 0.1-0.2 seconds. I figured it must be a time related thing, so then I added in that time would be speed up by 100x for 1 second after they hit X:100, but now matter how I play with these numbers it never has any significant impact on the "hiccup".

  • cool dude.

    yea, if you are serious about making this sort of game,

    or in fact serious about becoming a game dev full stop

    then just drop everything and go learn arrays and all the things they can do for you.

    then you will be like "yea I wanna reverse time, that be easy....."

    I never actually understood why arrays are even used at all, they just seem like a really confusing way to store data. Most of the information I've tried to digest about them is very beginner level, so the examples given on what you can do with them are always things that would be easier to keep track of with a labeled variable.

    I do understand that arrays are "powerful" I just don't know why. Definitely have a lot of learning to do... Maybe I should search this forum for arrays so I can see what other people are using them for and why.

  • For starting off, (just to understand) I would suggest simple test platformer (without physics)

    Then just make a 2 x 120 array (this will give you two seconds of rewind)

    and every frame populate the array with the x y position of the player sprite.

    probably use the push pop method for this.

    push adds the latest value to the top moving everything down and pop removes the oldest value from the bottom so the array does not keep growing.

    I'll definitely give it a try. Since you're hoping I do, I'll send you a .capx if I'm able to pull it off, but it will probably take me some time just to figure out how to populate the array with data.

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    I'd like to start working on this, but I don't know how to use arrays. I've read and watched a lot of tutorials about it in the past but could never wrap my head around it. Would you or anyone else be willing to show me how to put even a single one of these variables (such as angle or whatever) into an array that can be played backwards?

    If I can see how it works I could set it up for all the other variables, I should even be able to figure out how to use lerp() just fine on my own it looks pretty straight forward.

    https://drive.google.com/open?id=1Qzqph ... AsseETcFyM

  • Well it's not easier, or less work, but we have interpolation to make it less data intensive.

    So rather than save data every tick you could save it at every x milliseconds and use lerp() on the positions.

    That was going to be my next question, is how processing intensive would be to record all of these variables for all these objects per tick. Glad to know there's a way to cut down on that, thanks for the tip!

  • The only way to do this would be to record the position , angle, state, forces etc of all the relevant elements in your game into an array or set of arrays at 1/x s timing interval. Then run through the arrays backwards when you want to reverse time. So definitely possible , lots of games have done it. Just need a little ground work.

    This has also occurred to me... I was just hoping there might be a slightly less work intensive way of doing it. Thanks though, if a day goes by without any easier suggestions I'll definitely start working on this.

  • I think it's really cool that you can slow down and speed up time, but is there anyway to play it backwards? I know I can't put a negative number in, but is there a plugin or any other way to do this?

    My game uses physics, so the closest I can get to reversing time is reversing physical forces by stopping the velocities of all objects and then applying the opposite to them.

  • > What I do not understand is why when I refer to an instance variable it doesn't take into account for each individual instance's unique variables. I am under the impression that there is a universal solution for getting the system to make instances behave independently based on their uniquely different variables.

    >

    When you refer to instance variable, the system actually does this "for each picked instance".

    Say, if you do "Gun set var to random(10)", a different random number will be set for each instance of the Gun.

    And if you do "Gun set scale to var", they will all become different sizes.

    As for the Timer - this is not a workaround. This is the right way to do things in C2 when you are dealing with multiple instances and delayed actions.

    If you only have 1 gun, you can use "Every x seconds" or "Wait", no problem.

    If you have multiple instances of gun and they are firing/reloading at different times, it may be really difficult to get them working correctly with all these "Every x seconds", "Trigger once" and "Wait" events.

    In your last capx the problem is with the "Trigger once" condition.

    After one gun has fired, event #5 is triggered, all good. Then a second gun fires, but the first gun still has Cycling=1, this event will not be triggered, because it's still true and it has already triggered once.

    And then the first gun fires again, but event #5 is still true, so it's still not triggered and now both guns are stuck with Cycling=1.

    Here is a simple solution:

    Yes! Thank you so much dop2000, I'm starting to understand why I am running into these types of issues.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You mentioned earlier that the stating condition the "Every gun.interval seconds" only applies to the first instance, meaning that all other instances will fire on that interval instead of their one.

    Yes, that is the problem, I understand that. What I do not understand is why when I refer to an instance variable it doesn't take into account for each individual instance's unique variables. I am under the impression that there is a universal solution for getting the system to make instances behave independently based on their uniquely different variables.