![]() ![]() Sum the squares and find the root of the sum. Subtract the x's and y's, square the difference We do this by calculating the distance, and then checking if the distance is smaller than the radius of both circles summed up. ![]() For that we need to check if there is collision. Give it a random position with math.random We'll have them positioned randomly on screen. (player.image, player.x, player.y,Ġ, 1, 1, player.image:getWidth()/2, player.image:getHeight()/2) Set the origin of the face to the center of the image ("line", player.x, player.y, player.size)Īnd for fun, let's give the player a face. The players and coins are going to be circles I do this because else you wouldn't be able to move diagonally. Note how I start a new if-statement instead of contuing the elseif Create a player object with an x, y and sizeĮlseif ("right") then We start with a player that can move function love.load() But first we need to have a game, so let's make a small game where you can pick up coins. We do this by writing and reading a file. Let's make it so that we can save and load our progress in our game. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |