Nevermind, someone else helped me find the problem.
In util.lua, using "local instance = preset" didn't work, I had to use
local instance = {}
for k, v in pairs(preset) do instance[k] = v end
Search found 50 matches
- Mon Jan 23, 2017 2:48 pm
- Forum: Support and Development
- Topic: [SOLVED]Problems instantiating object in table
- Replies: 2
- Views: 2083
- Mon Jan 23, 2017 2:37 pm
- Forum: Support and Development
- Topic: [SOLVED]Problems instantiating object in table
- Replies: 2
- Views: 2083
Re: Problems instantiating object in table
I just downloaded the file in my PC and realized it's completely fucked. I made a quick rearrangement so that you can at least see what is happening
- Mon Jan 23, 2017 1:18 pm
- Forum: Support and Development
- Topic: [SOLVED]Problems instantiating object in table
- Replies: 2
- Views: 2083
[SOLVED]Problems instantiating object in table
There is a table named Items, and all of its contents is rendered every frame on screen. I have a Instantiate function that picks an item from the presets list and instantiates it in the given coordinates. The problem is that, when loading the map, all of the instantiated items seem to be in the sam...
- Sat Sep 10, 2016 11:18 pm
- Forum: Support and Development
- Topic: How to save tables in files
- Replies: 10
- Views: 5989
How to save tables in files
I'm making a tilebased game, and to make things easier i'm making a map editor. But once I finish a map using it, how can I save it to use later? I read about writing to files, but I want to save it as a TABLE, so I can simply access it later.
- Thu Sep 08, 2016 7:05 pm
- Forum: Support and Development
- Topic: Taking too much time to draw
- Replies: 6
- Views: 4396
Taking too much time to draw
My code iterates through a tile table every frame to draw it, but it's taking way too long. It's running at 10FPS.
- Thu Sep 08, 2016 3:10 am
- Forum: Support and Development
- Topic: [SOLVED]How to handle tile generation
- Replies: 7
- Views: 5812
Re: How to handle tile generation
Thanks guys, that was exactly what I needed. Now I can properly work on my game.
- Thu Sep 08, 2016 2:42 am
- Forum: Support and Development
- Topic: [SOLVED]How to handle tile generation
- Replies: 7
- Views: 5812
[SOLVED]How to handle tile generation
I'm making a tile-based game. For the tiles, I'm using two separate arrays for X and Y, and the movement works just as I want. But the problem is this: I want each tile to have properties such as wethrr it is a solid tile,it's sprite,percentage of oxygen (I'll try to simulate atmospherics) etc. I ca...
- Mon Aug 22, 2016 3:34 am
- Forum: Support and Development
- Topic: Move x pixels towards target
- Replies: 4
- Views: 2196
Re: Move x pixels towards target
I tried your code but I get the error ""=" expected near "==" in line 22". The line 22 would be the second line in your code.
- Mon Aug 22, 2016 1:15 am
- Forum: Support and Development
- Topic: Move x pixels towards target
- Replies: 4
- Views: 2196
Move x pixels towards target
This is probably a really stupid problem, but anyway: I have a bullet, and I want it to move, let's say, 2 pixels towards a target every frame. I already know how to move it towards something, like this: x = x + ((targetx - x) / 5) But it obviously slows down over time. It's smooth How can I move it...
- Sun Aug 14, 2016 4:46 pm
- Forum: Support and Development
- Topic: Love2D second .lua file problem
- Replies: 6
- Views: 5121
Re: Love2D second .lua file problem
Oh well, just realized what was wrong
The compiler said that there was a problem at physics.lua but it was at main.lua
The compiler said that there was a problem at physics.lua but it was at main.lua