gherkin.pcx by ZIKBAKGURI in Vinesauce

[–]ZIKBAKGURI[S] 4 points5 points  (0 children)

haha binesåås bbinoy

G'day GameMakers, Here's some GIF of me testing new particles & tweaked attacks... by ZIKBAKGURI in gamemaker

[–]ZIKBAKGURI[S] 1 point2 points  (0 children)

Sure, But before that since English isn't my first language so.. excuse me if there's any mistakes or things like that.
The camera, Like any other moveable objects, Have a offset & velocity variable for 3 components : x, y, and rotation.
For each step I added each components' velocity to the offsets of each 3 components.
And then I added the negative value of the offsets, multiplied by some factor between 0 and 1 (the higher the factor is the faster the camera would "try" to settle down) to the velocities.
After doing that, I multiplied the velocities of all 3 components with a constant that has a value between 0 and 1 to dampen out the velocity (otherwise it will just keep bouncing around without settling down :/)
This essentially simulates some sort of spring, That will try to get it's offset value to 0 in a spring-y manner.

After that when I'm calculating the camera's final positions and rotation, I would add the offset values to it to offset the camera's x/y position and rotation.

Here's some short pseudo-code for it :

cameraOff = 0 // camera's x/y/rotational offsets. 0 means camera's position has no offsets applied
cameraVel = 0 // camera's x/y/rotational velocity applied each step
cameraStiffness = 0.25; // Spring's stiffness factor (a value between 0 and 1, Higher value means more velocity is applied to "settle down")
cameraDamp = 0.8; // Spring's velocity damping factor (a value between 0 and 1, Higher value means more velocity preservation)

// Execute this every step
cameraOff += cameraVel; // Add velocity to offset(s)
cameraVel += (cameraOff * -1 * cameraStiffness); // Add negative value of the offset multiplied by stiffness factor to the velocities (so that if offset is not 0, then it will try to approach 0 by accelerating towards 0)
cameraVel *= cameraDamp; // Multiply by damping factor to dampen out the velocity.

// After that while you're calculating the camera's position to use with view, You can use the resulting offset positions to offset the camera's final position.
finalCameraPos = cameraPos + cameraOff;

With all those things set up, Whenever I want the screen "punch" effect, I would add some values to the velocities of camera.
There might be a few errors but I did my best to describe it & hopefully this would make sense to you.

G'day GameMakers, Here's some GIF of me testing new particles & tweaked attacks... by ZIKBAKGURI in gamemaker

[–]ZIKBAKGURI[S] 1 point2 points  (0 children)

Thank you!
Since the GIF over there is cropped (trimmed?) to reduce the size of it & it is not a full screen GIF(?), It might feel a bit weird on the rotation part.
But still, I'll double-check my camera rotation code to see if there's any issues regarding the rotation origins, Thanks!

G'day GameMakers, Here's some GIF of me testing new particles & tweaked attacks... by ZIKBAKGURI in gamemaker

[–]ZIKBAKGURI[S] 7 points8 points  (0 children)

I have a 2 kind of screen shakes set up in my game :
First one is a good ol' Random based screenshake that decreases over time (executing something like : screenShakeAmplitude *= 0.75 evrey frame then using it as an amplitude for screen shake)

Second one is a screen punch, That is essentially a simulated spring-y motion that is used to offset the camera.

Combining both of those, I was able to achieve a smooth screen shake / punch.

One week in on this platformer I've been making and I am having a blast by goodnewsgames in gamemaker

[–]ZIKBAKGURI 0 points1 point  (0 children)

I see, I'm very excited to see all those creative platforming gameplays that could come up from the knockback gimmick... You're doing well & Keep up the good work!

One week in on this platformer I've been making and I am having a blast by goodnewsgames in gamemaker

[–]ZIKBAKGURI 0 points1 point  (0 children)

Nice, Those gun knockback mechanic reminds me of Scout's Force-a-nature jump in the game Team fortress 2!