Arcticus's Recent Forum Activity

  • It works with other behaviors, it should work with ball too.

    But anyways, since it seems like i'm not going to be able to set the ball movements X/Y velocites, how does the ball behavior determine the angle of bounce?

    Because I've got a custom movement set up and I really need ball/physics type bounces but those are dam hard for me to code.

    Wouldn't it be cool to have some sort of generic 'bounce off object' type function, regardless of behaviour, where you put in the player object's X and Y velocites, and that of the obstacle (if it's even moving) and then construct does whatever it does to figure out the bounce direction for the ball and returns the new X and Y components for the player object which you would then have to store somewhere obviously.

    I understand this is a pretty flighty, unrealistic and almost fictional suggestion, but it would be cool to be able to do realistic bounces (as in those that take into consideration the shape of the sprite) to custom movements. I'm not sure how you would go about it since the X and Y velocites would be stored in variables so if that system ever worked you would have to find a way to return two separate values which you can then assign to whatever you want.

    If you're thinking, 'But Arcticus, just use the ball behaviour, it bounces fine', yes it does bounce fine, but not when it's angle of motion is fixed because of using varibles for X and Y velocites instead of editing the ball's X/Y components directly. Setting the angle of motion and speed i can do fine, it's the bounces that it stuffs up.

    Here's a little example of what i mean if you don't get me, it uses the platform movement only to show that proper bouncing whilst using the Set X component and Set Y component is completely possible, please ignore the odd direction of the platform bounce as it is not intended to be used this way:

    http://www.mediafire.com/?zr2keikuwnn

    Hopefully that conveys what I want

  • But the ball behaviour's X/Y components will change automatically upon collision would they not? whereas if i had to use variables i would have to find a way to calculate the new velocities

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You sure? Cause if there was a set X/Y component, I wouldn't be using variables and wouldn't have to override the velocity.I would be adding a certain value to the component's current value, not setting it to a fixed amount. Making it, to my understanding, so the ball will still bounce off obstacles.

    So let's say when i press forward it adds 2 to my X component

    Say the ball object is travelling at an X component of 50, i press forward, it takes the current X comp and adds 2 to it, making my ball object travel at 52 pps

    Suppose then the ball collides with something, the ball behaviour, to my understanding then calculates the new angle of motion and adjusts the X and Y components, so let's say that after said collision, our X component is now -52

    I press forward again and it adds 2 to the X component again making it -50

    See where i'm going? This way, the current X/Y component is taken into account when moving the player. Is my thinking wrong? Did I explain myself properly?

    Otherwise i WILL probably have to make my own custom movement.

    The only problem I can see with making my own ball movment is I can't get the bounces and angle of motion after the collision as accurate as the ball behaviour does. As in, the ball behaviour seems to take into account the shape of the sprites, whereas i cannot find the shape of things using events very easily.

    Anyways thanks for reading and all the work you're doin

  • Sorry to ressurect this slightly older thread, I've been unable to use my internet for a long time. Thanks for the suggestion fantasyjam but i think what i want is slightly different.

    What i want to do is similar to the movement that i made in my super speed example in the 'your creations' forum.

    I want to update the X and Y components of movement every tick to give a controlled 'space' type movement. I can get the movement moving exactly how i want it to move, except i can't for the life of me code in the right collision code.

    See with something like:

    set angle of motion (0, 0, Xvariable, Yvariable)

    set speed to distance (0, 0, Xvariable, Yvariable)

    The movement works prefectly, until you collide with something, the ball/player just tries to keep going through the obstacle rather than bounce off because it's X and Y components of motion are fixed into variables rather than being updated upon a collision, meaning, so is the angle of motion.

    What i would like (semi pseudo code):

    Always:

    set angle of motion (0, 0, Ball X component, Ball Y component)

    When W(forward) is down:

    set ball X component to ball X component + (cos(player angle) * AccelerationVariable)

    set ball Y component to ball Y component + (sin(player angle) * AccelerationVariable)

    If i could alter the ball movements X and Y components directly, just like i can in platform or physics, i would still be able to get the spacey type motion but bounces would work perfectly fine too because the ball behaviour works out which angle to bounce at and changes the X/Y components accordingly. It would also open up more avenues for advanced ball movement controls, like what you're doing, you could easily make multiple gravity wells.

    I hope i made myself clear enough :S

    Anyway, to summarise my post, I'm begging you Ashley to add set X/Y components to ball behaviour!!!!!!

  • I'm at college so i can't check, but does the platform movement bounce? I'm really using the ball movement so i don't have to code realistic bounce formulas

  • I usually run it around 10x motion blur vsync, but i lowered it so it would be easier on other people's systems, I also left it on unlimited fps to demonstrate that it isn't a fake slow motion/super speed, the game is -actually- making the player move dam fast.

    For fun, you can change the global variable TimeScaleTarget at the start of the layout to like 0.000001 to make the player move ONE MILLION times faster than normal speed, it makes it look like you froze time. But I have experienced one or two crashes when doing this. I figure the one thousand times faster is still pretty impressive

    I would prefer not setting the time scale every tick even when there is no change in time scale but it returned inaccurate results if i did otherwise.....

    Also as a side note Ashley: The type of movement in this example is what I'm trying to make with the ball and physics behaviours, which is why I wanted to be able to set X/Y components for the ball. It works fine with physics (once the new engine is fixed . Personally I would prefer to do it all as a custom movement but the collisions are SO hard to code right, so I figure I will let the ball behaviour sort it all out for me.

  • Hey guys

    I been working all day on this one. It's a refresh rate independant example of messing around with timedelta and timescaling to create super speed similar to that of jedi knight.

    It's a little buggy still but I reckon it's cool as all hell (yes i realise the irony of what i just said...)

    Side note: I usually don't comment my files, although I know it's a good habit to get into, but i'm not so good at it, but I did this time just so you could understand a little better what it was i was doing, any questions or feedback just gimme a yell.

    Cap right here

    http://www.mediafire.com/?xn0gc2me2zi

  • I was originally doing something like that but what I found was, since i was using variables for my 'Xforce' and 'Yforce', it messed up the bounces pretty hardcore. The object was trying to push through obstacles rather than bounce off them since the X/Y components were 'set in stone' so to speak and it was hard to alter the variables upon collision to make the ball bounce off at the right angle.

    If you don't think it's appropriate to add them, that's fine, I guess I am using the ball behaviour a little differently than it should be used.

  • It does ask you to save, just at a different time than I expected.

    But after poking around with this close project bizzo I stumbled a across a bug.

    If you close the project from the project tab, the contents of the other tabs (with the exception of the animator tab i think) remain as they were when the game was open. Upon clicking on the items remaining in any of these tabs, construct crashes to the desktop.

    I have added it on sourceforge

  • I don't suppose it would be possible to add a set X component and set Y component to the Ball behaviour would it?

    Plus while I'm writing, are you aware that the ellipse collision mask for the new physics engine is a perfect circle regardless of the dimensions of the physics object?

    Thanks

  • Man that one plauged me for ages

    How silly of me

    Thanks Rich!

  • Actually yeah I thought about that after I made the post, the way I close the caps is like how i close any other project in any other application that supports multiple windows of different files, and that is that I just click on the little X under the X that closes construct, the open project's X so to speak

    Upon closer inspection after looking at the project bar I feel a lot more like an idiot since it's still there once I press the X

    This is deliberate correct?

Arcticus's avatar

Arcticus

Member since 23 Nov, 2007

None one is following Arcticus yet!

Trophy Case

Arcticus has no trophies yet!

How to earn trophies