Search found 90 matches
- Mon Dec 05, 2016 1:23 am
- Forum: Support and Development
- Topic: All game entities [unintentionally] act as one entity
- Replies: 3
- Views: 2108
- Sun Dec 04, 2016 11:13 pm
- Forum: Support and Development
- Topic: All game entities [unintentionally] act as one entity
- Replies: 3
- Views: 2108
All game entities [unintentionally] act as one entity
First, I should clarify, I mean All game entities of the same class act as one, not all game entities. This is how I code the entities, first I put them in my own file then add functions: local myEnt = {}; myEnt.__index = myEnt; setmetatable(myEnt, {__index = myEnt}); function myEnt:new(x, y, custom...
- Sun Nov 06, 2016 7:52 pm
- Forum: Support and Development
- Topic: Game runs insanely fast on 144hz screen
- Replies: 3
- Views: 2228
Game runs insanely fast on 144hz screen
This is how I move my character in my game: if (up) then self.vely = lerp(self.vely, -self.moveSpeed, dt*6); end if (left) then self.velx = lerp(self.velx, -self.moveSpeed, dt*6); end -- etc. However on my 144hz monitor, the game runs hilariously fast, I have no idea how to fix this, shouldn't dt ma...
- Tue Feb 16, 2016 7:42 pm
- Forum: Support and Development
- Topic: Multithreaded Loading Screen... problems
- Replies: 4
- Views: 1560
Re: Multithreaded Loading Screen... problems
while true do task = tasks:demand() local ret = {name=task.name} if task.type == "image" then ret.data = love.image.newImageData(task.image) else if task.type == ..... end results:push(ret) end values = {} function love.load() tasks:push{type="image", image="logo.png"}...
- Tue Feb 16, 2016 7:13 pm
- Forum: Support and Development
- Topic: How to set different frames per second and updates per second and be able to change after loading?
- Replies: 8
- Views: 4588
Re: How to set different frames per second and updates per second and be able to change after loading?
The Source Engine also works this way. It's called "ticks." It keeps track of how many ticks should be done in the amount of time passed, and ticks until it catches up. It's probably a better solution than dt, you won't have things going through walls. http://greyminecraftcoder.blogspot.co...
- Tue Feb 16, 2016 5:46 am
- Forum: Support and Development
- Topic: Multithreaded Loading Screen... problems
- Replies: 4
- Views: 1560
Multithreaded Loading Screen... problems
The way my asset loading works is it queues them all up in a queue table with info about each "asset load request" then when a function is called it loads them all at once while displaying a loading screen. There are 2 problems: 1. You can't use love.graphics in threads, even to load image...
- Tue Feb 16, 2016 1:39 am
- Forum: Support and Development
- Topic: Free up memory by destroying images/sounds
- Replies: 5
- Views: 1647
Re: Free up memory by destroying images/sounds
Yeah it will be freed by the Lua garbage detector, but how can I be sure the texture itself will actually be destroyed by OpenGL?bobbyjones wrote:Setting to nil will allow for it to be collected and freed. Also try lazy loading
- Tue Feb 16, 2016 1:25 am
- Forum: Support and Development
- Topic: Free up memory by destroying images/sounds
- Replies: 5
- Views: 1647
Free up memory by destroying images/sounds
I have a huge amount of images and sounds I load, but I only need most of them at certain times or in certain levels. So once I've loaded an image, how do I get rid of it? Not setting it to nil, I mean actually deallocate the memory (unless setting it to nil somehow mysteriously gets rid of it's all...
- Fri Jul 03, 2015 4:17 am
- Forum: Support and Development
- Topic: draw entities based on their depth
- Replies: 2
- Views: 1834
draw entities based on their depth
so right now my game just draws entities based on the order they were created (newest ones on top) which is normal since it just goes through the entities table and every entities place in the table is determined by the number of entities created since the game started plus one. but how would i make...
- Thu Jul 02, 2015 3:47 am
- Forum: Support and Development
- Topic: velocity (without love.physics)
- Replies: 2
- Views: 1513
velocity (without love.physics)
this is the way my entity currently moves: self.x = self.x + math.cos(self.rot-math.pi/2) * self.speed; self.y = self.y + math.sin(self.rot-math.pi/2) * self.speed; which makes it always move in the direction it's facing, no matter what. but the way i want it to work is when you press forward instea...