Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(+3)

Day 9:

I tried to add some camera movement, making the camera follow the mouse. I think it really brings the game together, especially the cards!

I added the docks and the ships to the game, and added an animation on the ships to make them look a little more active, you can see it at the end. I'm having some trouble with reusing the animation on the other ships, but I think I figured out how to do it, just need to redo the animation.

The bigger problem is limiting the camera movement. I'm having trouble clamping the camera to the play-area. I tried a few options, but all of them either do nothing or cause the camera to start convulsing and shaking. Does anyone have any ideas how to limit the rotation of the camera for Godot? Right now, I raycast to the mouse position from the camera. I have collision set up on the land. I have a dummy spatial node next to the camera, on which I use look_at to make it look at the raycast collision point. Then, I use a tween to modify the transform.basis of the camera to match the dummy node. However, I'm not sure how to limit the rotation. The basis values, or even Quat of the basis does not make much sense to me. I would very much appreciate any help.

I think I might modify the code for the camera movement later to manually do rotations based on the mouse location (e.g. if on the left side of the screen, rotate 1 degree to the left every frame until 5 degrees). I'll have to try that later.