Slastraf Posted February 17, 2016 Posted February 17, 2016 I want to make a Game like shown in the screenshot. The Ship that needs to fly around obstacles, part of them rotating, Is controlled by the mouse. How do I start making one like those ? what functions of the ducomentation are useful ? Quote
thehankinator Posted February 17, 2016 Posted February 17, 2016 (edited) The first thing I would try (actually the second, the first sucked) would be to position the mouse in the middle of the screen, then using Window:GetMousePosition() get the x/y delta, follow that with a Window:SetMousePosition() (same way that FPSPlayer gets the delta). Then I would create a Vec3, with delta x/y in it with z for the speed. You could then use that Vec3 with Entity:AddForce() (maybe Entity:PhysicsSetPosition() if you add the Vec3 to the current ship position, not sure which would work best) on the ship. Gotta make the camera follow the ship also, could be done by making the camera a child of the ship or something but I don't think that's what you are asking about. There might be an easier way to do it, I'd be curious what others come up with. EDIT: Had to rethink the speed part. Edited February 17, 2016 by thehankinator Quote
Slastraf Posted February 18, 2016 Author Posted February 18, 2016 I used PhysicsSetPosition, the documentation example applies for what is used in my game. For anyone doing the same game as me right now, just go the physicssetposition documentation: http://www.leadwerks.com/werkspace/page/documentation/_/entity/entityphysicssetposition-r190 and transfer the example for your game Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.