Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(6 edits)

Real Actual Devlog :


Day One :

So i started by creating my scene and a "piece" sprite with dummy ugly drawings.

My scene

Here you can see the terrible drawings, and also, because the board is fixed, i made it as a sprite and not as a map object (Is it okay ?) Also, the "move with wasd" thing doesn't work, so i got to zoom in and out to move.

And so i started my first script : the thing that makes the pieces follow the mouse when clicked. My idea was that we check if the left button is clicked, and that if it's true, if the piece is at the same position as the mouse, we update the piece's position with the mouse's one.

But MousePosition gives me a Vector2 while actor.getPosition gives me a Vector3 and i can't compare those :/ (i know it's casting but i don't how to do that in typescript yet)


 

So, asserting Vector3 as a Vector2 is impossible because of incompatible methods; so instead i compared Vector2 y with Vector3 y and Vector2 x with Vector3 x. I ran without errors :D but now i have a piece coming out of the void, and that follows the mouse but not too much lol.

MMMMMmmmh i have a weird problem, i get mouse position and actor position, but even if the mouse is over the actor, their coordinates aren't even close ? Wth O_O


Day 2 :

Okay, i used a Ray to check when i click my object, it seems to be better but i still have the same problem : Mouse and Actors coordinates are never the same in super powers ? like, i get it, one is 3d and the other is 2d; but when x and y are compared they're nooooot the same at all :||||