I am looking to code a football heads game and need some help on how to implement gravity into my game. The ball and the players will need to be included in this gravity, especially the ball. Any help would be appreciated.
Welcome!
Check this out:
And this:
You will probably want to use kinematic objects, so you can decide how the physics works. Dynamic objects have the engine simulate the physics on your behalf - that could be what you want as well.
Cheers pal, do you have any example code that I could use for inspiration.
Sorry I don’t. Someone else might jump in with something useful.
In the meantime I encourage you to start experimenting with the basics!
What kind of design are you looking to make? Implementation depends on what you want to do.
There’s also the examples here:
Hi everyone, sorry for the long wait but i’ve finally come back to my project. I am a newbie to Defold and I am trying to create a game from scratch. If I were to post my project here would anyone be able to help me. I am trying to make it so that when the ball hits the net it counts as a goal, and adds to the score. I am also trying to stop the ball from leaving the screen and also sometimes the collision object on my player1 will not work so the ball goes through the character.
Thanks!
You can put “invisible collision objects” at the edges to prevent the ball from going off the screen.
Remember that for collision with an object to work, the collision mask and group for the object initiating and receiving the collision have to be set properly.
Try and read the links posted above, they would really help you.