Search found 46 matches

by louie999
Wed Jul 15, 2015 10:23 am
Forum: Support and Development
Topic: Am I making it right?
Replies: 3
Views: 430

Re: Am I making it right?

Thanks for the help guys, but I've decided to use LoveFrames instead :)
by louie999
Tue Jul 14, 2015 4:54 pm
Forum: Support and Development
Topic: Am I making it right?
Replies: 3
Views: 430

Am I making it right?

I'm trying to create menu buttons for my game, I tried to make a function that detects whether the mouse cursor is *on* the text of the menu button, here's the code for the function: local function isButtonClicked(mx, my) for _, m in pairs(gamemenus) do local rsx, rsy = m.scaleX, m.scaleY local strX...
by louie999
Fri Jun 05, 2015 10:31 am
Forum: Support and Development
Topic: Remove value in table when a body gets destroyed?
Replies: 7
Views: 1106

Re: Remove value in table when a body gets destroyed?

Positive07 wrote:
louie999 wrote: Hmm will this work?
Try it! but yeah, it should
Well it kinda works :)
by louie999
Fri Jun 05, 2015 3:52 am
Forum: Support and Development
Topic: Remove value in table when a body gets destroyed?
Replies: 7
Views: 1106

Re: Remove value in table when a body gets destroyed?

You need to give table.remove() the numeric index for the sub-table you want to remove. You could do this by looping through using ipairs() instead of pairs(), and when you find the unit you want to remove then you'll have the index to give to table.remove(). At which point you should break out of ...
by louie999
Thu Jun 04, 2015 11:51 pm
Forum: Support and Development
Topic: Remove value in table when a body gets destroyed?
Replies: 7
Views: 1106

Remove value in table when a body gets destroyed?

So in this code: function love.mousepressed(x, y, button) if player.getState(1) == "is-playing" then if button == "l" then unit_value = unit_value + 1 table.insert(units,{unit_id = lp.newBody(map, x, y, "kinematic"), img = lg.newImage("gfx/turret3.png"), x = tonumber(x), y = tonumber(y), id = unit_v...
by louie999
Thu Jun 04, 2015 6:14 am
Forum: Support and Development
Topic: How to load values from a .txt file?
Replies: 19
Views: 3164

Re: How to load values from a .txt file?

In the main.lua you posted a few posts ago you didn't render the images. Also you didn't store the images you created using love.graphics.newImage() anywhere. I fixed that in my main.lua in my example. So when I store the love.graphics.newImage(), then I need to use love.graphics.draw() to make it ...
by louie999
Wed Jun 03, 2015 4:20 pm
Forum: Support and Development
Topic: How to load values from a .txt file?
Replies: 19
Views: 3164

Re: How to load values from a .txt file?

When creating the .zip you have to make sure you add the other folders too. Did you open the "Games" folder with löve when you tested your code? I made a small example.love with images from the wiki. OH, now I get it. So I put the folders(with the files) in the .zip file then I changed it to a .lov...
by louie999
Wed Jun 03, 2015 2:54 pm
Forum: Support and Development
Topic: How to load values from a .txt file?
Replies: 19
Views: 3164

Re: How to load values from a .txt file?

Can you press open a command line and cd to the directory and run "dir" and post the output of dir? (To do that press start type "cmd" press enter. Type "cd C:\Games" + enter in the new window. Then type "dir".) I don't know if I did it correctly but: http://i.imgur.com/0nPmdXS.png That file's lite...
by louie999
Wed Jun 03, 2015 2:24 pm
Forum: Support and Development
Topic: How to load values from a .txt file?
Replies: 19
Views: 3164

Re: How to load values from a .txt file?

Ok here's the .love file. Obviously you either misspelled the filename or path or put the file or folder into the wrong directory. I didn't misspelled it, I've checked it over 10 times and nothing is misspelled. The file path for the main.lua file is C:/Games/main.lua and the file path for the map1....
by louie999
Wed Jun 03, 2015 11:51 am
Forum: Support and Development
Topic: How to load values from a .txt file?
Replies: 19
Views: 3164

Re: How to load values from a .txt file?

Then you want that one line to look like this: for row in love.filesystem.lines("maps/map1.txt") do Unfortunately I also tried that but it's the same result: main.lua:4: Could not open file maps/map1.txt. Does not exist. Traceback [C]: in function 'lines' main.lua:4: in function 'load' [C] in funct...