Search found 83 matches

by mr_happy
Fri Aug 17, 2018 7:06 pm
Forum: Support and Development
Topic: Shrinking numbers
Replies: 2
Views: 220

Re: Shrinking numbers

Thank you for the detailed reply, it makes perfect sense, I shall try to incorporate it in my code :D
by mr_happy
Fri Aug 17, 2018 3:43 pm
Forum: Support and Development
Topic: Shrinking numbers
Replies: 2
Views: 220

Shrinking numbers

Why do the values gradually 'shrink' with this piece of code which rotates points in 3d around the y axis: cos1 = math.cos(math.rad(1)) sin1 = math.sin(math.rad(1)) for i = 1, numPoints do points[i].x = points[i].x * cos1 + points[i].z * sin1 points[i].z = points[i].z * cos1 - points[i].x * sin1 end...
by mr_happy
Tue Aug 14, 2018 10:03 am
Forum: Support and Development
Topic: Camera Zoom to Mouse
Replies: 4
Views: 286

Re: Camera Zoom to Mouse

Actually, I've just realised that doesn't do quite what you want! You don't want any movement of the camera until the mousewheel is scrolled - shouldn't be too hard to fix that though :D
by mr_happy
Tue Aug 14, 2018 9:59 am
Forum: Support and Development
Topic: Camera Zoom to Mouse
Replies: 4
Views: 286

Re: Camera Zoom to Mouse

Well I've never used a camera library but this code does what you want (I think - test it by adding some more images) and is pretty self-explanatory. If you're committed to using a library I'm afraid I won't be able to help further. supcom.jpeg function love.load(arg) love.graphics.setBackgroundColo...
by mr_happy
Mon Aug 13, 2018 8:34 pm
Forum: Support and Development
Topic: Camera Zoom to Mouse
Replies: 4
Views: 286

Re: Camera Zoom to Mouse

Can you clarify this a bit? When you zoom in, do you want the view to be automatically repositioned (or at least moved towards) to the centre of the screen as well? If not, some points around the zoom centre might disappear from view altogether. For example, if your window is 800x600 and the mouse i...
by mr_happy
Thu May 17, 2018 10:44 am
Forum: Support and Development
Topic: Why this error on love.event.quit() ?
Replies: 8
Views: 522

Re: Why this error on love.event.quit() ?

I don't see how line 149 is being executed after the call to love.event.quit(). love.event.quit() places a 'quit' event in the event queue. It does not terminate the program immediately. Use os.exit() for that. OK thanks. I thought it might be something to do with that but I thought it would most l...
by mr_happy
Thu May 17, 2018 10:02 am
Forum: Support and Development
Topic: Why this error on love.event.quit() ?
Replies: 8
Views: 522

Re: Why this error on love.event.quit() ?

Right, I've found what causes the error but not why it only happens when exiting with the keyboard. function love.keypressed(key) if key == 'escape' then love.event.quit() end -- HERE'S THE PROBLEM: local tX, tY = 0, 0 if key == "left" then tX = player.x - 1 tY = player.y end if key == "right" then ...
by mr_happy
Thu May 17, 2018 9:49 am
Forum: Support and Development
Topic: Why this error on love.event.quit() ?
Replies: 8
Views: 522

Re: Why this error on love.event.quit() ?

Can you post the whole code? I'd prefer not to at the moment as it contains the tiniest grain of an idea I'd like to keep to myself atm :D I moved if key == 'escape' then love.event.quit() end to the end of love.keypressed() but the result is exactly the same. I don't see how line 149 is being exec...
by mr_happy
Thu May 17, 2018 8:24 am
Forum: Support and Development
Topic: Why this error on love.event.quit() ?
Replies: 8
Views: 522

Why this error on love.event.quit() ?

In function love.keypressed() the first line is: if key == 'escape' then love.event.quit() end If I close the game window using the escape key I get this: Error: main.lua:149: attempt to index a nil value stack traceback: [string "boot.lua"]:637: in function '__index' main.lua:149: in function <main...
by mr_happy
Sun May 13, 2018 6:45 pm
Forum: General
Topic: Is this a good way to handle tile collision and generation?
Replies: 8
Views: 711

Re: Is this a good way to handle tile collision and generation?

(They look a little like they are circles joining. Maybe its coincidence) It's a little like that when run in its basic form but you can change various factors to radically alter the map. The game I was working on (before it began to get too complex!) used it to generate two continents with an ocea...