Search found 113 matches
- Fri Dec 30, 2022 12:36 am
- Forum: Support and Development
- Topic: I have a glitch in my game
- Replies: 2
- Views: 1064
Re: I have a glitch in my game
The variable currentAnim is a global variable that is shared by player.lua and polly.lua . Do not use globals for animations, but class fields instead: function Polly:animations() -- loads in animations local g = self.grid self.idle = anim8.newAnimation(g(("1-4"), 1), 0.1) self.runAnim = a...
- Sat Nov 19, 2022 11:40 pm
- Forum: Support and Development
- Topic: Trouble with a seemingly simple snake game(Solved!)
- Replies: 13
- Views: 2553
Re: Trouble with a seemingly simple snake game
Setting occupied = false at the beginning of the loop will fix the issue: --snake.lua, starting from line 137 local occupied = false repeat occupied = false newfood_position = {math.random(1,25),math.random(1,25)} for i,v in pairs(snake.all_positions) do if v.x == newfood_position[1] and v.y == newf...
- Mon Jul 18, 2022 3:44 pm
- Forum: Support and Development
- Topic: Coding challenge: convex shapes
- Replies: 10
- Views: 4413
Re: Coding challenge: convex shapes
I notice not all segments 'move' - either a bug or your algorithm keeps moving the same three points because that reaches success the fastest? I think this is a limitation of growing a convex shape point by point. If you have a few points on a line (or nearly on a line) it is very hard to move thos...
- Sun Jul 17, 2022 5:56 pm
- Forum: Support and Development
- Topic: Coding challenge: convex shapes
- Replies: 10
- Views: 4413
Re: Coding challenge: convex shapes
You can just use brute force. This will work within a few attempts (most of the time). I attached a simple example.
- Sun Jul 17, 2022 3:21 pm
- Forum: Support and Development
- Topic: Coding challenge: convex shapes
- Replies: 10
- Views: 4413
Re: Coding challenge: convex shapes
Just a small nitpick: Just keep in the green, cyan or magenta areas. You cannot move point A into the magenta area, because this would decrease the overall area of the polygon which is against togFoxs first point: Starting with the square, each time the player receives a reward, two segments (or one...
- Sun Jul 10, 2022 4:38 pm
- Forum: Support and Development
- Topic: I have 1 question.
- Replies: 10
- Views: 4954
Re: I have 1 question.
How can I make a game like duskers? Specifically the map generation (universe and ship generation). How would you generate those two things with pen and paper? This should give you an idea how to write an algorithm. My first instinct: universe generation Temporarily place a point on a random spot o...
- Sat Jun 25, 2022 7:22 pm
- Forum: Support and Development
- Topic: how to record and play game input?
- Replies: 13
- Views: 4040
Re: how to record and play game input?
Roughly, it would consist of this. If you use love.keypressed/keyreleased/textinput, you need to record the call with all the parameters that you use, together with their timestamp. The timestamp would be a variable updated by love.update(). If you use joystick callbacks, same thing. In love.update...
- Mon Jun 20, 2022 7:59 pm
- Forum: Support and Development
- Topic: help me with my game plz
- Replies: 3
- Views: 1699
Re: help me with my game plz
You iterate over all shops in love.update, but you use the same variable to determine a collision. And this variable gets overwritten in every iteration of the loop. So only the last button will work - and it does. For this to work you have to make a collision variable for every button. I added a va...
- Fri Jun 17, 2022 11:13 pm
- Forum: General
- Topic: Need help creating a specific function
- Replies: 12
- Views: 4974
Re: Need help creating a specific function
The x and y position are independent and therefore can be calculated independently. I just calculated the formula for x, but for y it is the same: lerp.jpg The first part is a sketch of the function. Before the delay and after the delay + the duration the enemies do not move. In between I used an li...
- Sat May 14, 2022 4:53 pm
- Forum: General
- Topic: Android Start game as Service and alerts message Update! please
- Replies: 2
- Views: 2543
Re: Android Start game as Service and alerts message Update! please
Without taking a look at the specifics: I think you have to copy love-android and add the Android Service code yourself. If you want to use features of Android services from within your lua files, then you need to add those to the love sourcecode as well, I guess.