Loading...
74
10 months ago

I got so bored of waiting for Art Fight's website to work, so I did a bunch of wacky math shit (I hate math btw)

I will explain how it works in the Article cuz im a Nerd


It gets the position of the player, then the position of the mouse.

after doing both of those things, it calculates a little distance between the mouse and the player player.global_position.distance_to(mouse.global_position)and then divides that by 100 because there's a LOT of pixels on your screen.

then it gets the midpoint between those two points, by its regular formula... (x1 + x2) / 2, (y1 + y2) / 2

for x however, it applies 2 * distance_to_mouse and for y it adds 70 * distance_to_mouse if the mouse is below the player

and takes away 70 * distance_to_mouse from y if the mouse is above the player.

Here's a visual screenshot of the 3 points used for Interpolation (The Pink Blocks):

image.png

then it takes those 2 positions and interpolates them 50 times (so the curve is smooth) by doing

func bezier(t, p0, p1, p2):

var q0 = p0.lerp(p1, t)

var q1 = p1.lerp(p2, t)

var r = q0.lerp(q1, t)

return r

no clue how it works, I found it on godot's page but it works, p0 is the player, p1 is the midpoint, p2 is the mouse and t is is the "time" of the curve, so we kinda "render" it point by point, (0 to 1)



2 comments

Loading...

Next up

The combat system is already being implemented and there are also some advances with the environment (WIP)

#gamedev #indiedev #godot

We’re excited to announce that we’re working on a new game, a 3D metroidvania with a Low Poly Pixel Art style. Stay tuned for more updates!!!

#gamedev #indiedev #pixelart

Zombie in action! #GameDev #Art #PixelArt

Short intro of us 💕✌️

We're an eletro duo based in Seoul 🇰🇷 Heavily influenced by the 90s.

Our new album #Xennials is all about the nostalgia of that era 💽 CD listenin 📟 beeper beepin 💾 floppy disks floppin days 😎

Stream now! 🎧

https://open.spotify.com/album/3YwWhnHWVy5cA8XOpbaGRA?si=8E9awqU…

This Satuday we invite to watch another #speedpainting of our artist Daniel Faiad.

How great is this scene of #Pecaminosa?

#ScreenShotSaturday | #IndieDev | #DigitalArt

art comission.

We are under attack!

Successful landing

#screenshotsaturday

We made a lot of improvements on the Freezing Plains visual. Things like pine trees, tiny bushes, some rocks, and others game props!

#IndieGame | #IndieDev | #GameDev | #PixelArt | #WaifuQuest | #WifeQuest | #screenshotsaturday

The Darkside Detective: A Fumble in the Dark is out TODAY! 🖱️Advanced pointing, clicking action 🖨️Very funny words! Loads of them! 👻6 sarcastic, spectral cases to solve