Search found 98 matches
- Tue Feb 19, 2019 7:39 pm
- Forum: Support and Development
- Topic: How does scaling work?
- Replies: 2
- Views: 2523
Re: How does scaling work?
LÖVE displays a window with the resolution you give it in conf.lua or love.window.setMode. This is the space you have to work with. Next, your images/sprites/animations also have a resolution. LÖVE will not, by default, scale your images for you. With your background example, if your game window is ...
- Tue Feb 19, 2019 7:20 pm
- Forum: Support and Development
- Topic: Problem with hanging and reading stdout from python in threads
- Replies: 10
- Views: 12232
Re: Problem with hanging and reading stdout from python in threads
OK, I found success by using Lua coroutines instead of LÖVE threads. Check out the attached code. You'll need to install the "luaposix" library (easy with LuaRocks). Bonus: there's no child threads or processes, it's all contained in a single thread.
- Mon Feb 18, 2019 9:27 pm
- Forum: Support and Development
- Topic: Problem with hanging and reading stdout from python in threads
- Replies: 10
- Views: 12232
Re: Problem with hanging and reading stdout from python in threads
#!/usr/bin/env python3 import sys import time while True: # print("test") sys.stdout.write('test') sys.stdout.flush() time.sleep(1) First check: are you actually printing out complete lines in your test cases? The above code doesn't print out any "\n" characters, which means p:r...
- Sun Feb 17, 2019 6:35 pm
- Forum: General
- Topic: Coding Help
- Replies: 8
- Views: 5618
Re: Coding Help
1. Not critical, but you might want to look into using the "local" keyword when declaring your variables (global variables are, in general, bad practice). 2. This does absolutely nothing: love.timer.step(playerx - playery) 3. Get rid of the ox/oy arguments to draw (they just make the math ...
- Sun Feb 17, 2019 4:57 pm
- Forum: Support and Development
- Topic: How to delta time properly?
- Replies: 3
- Views: 4215
Re: How to delta time properly?
Correct me if I'm wrong, but wouldn't one of the simple friction equations be:
Also, very nit-picky, but what you call "speed" seems to be acceleration.
Code: Select all
player.xv = player.xv - friction * player.xv * dt
player.yv = player.yv - friction * player.yv * dt
- Sat Feb 16, 2019 11:38 pm
- Forum: General
- Topic: Coding Help
- Replies: 8
- Views: 5618
Re: Coding Help
You'll have better luck getting help if you include a .love file or show some relevant source code. Are you new to programming in general, or just LÖVE? You're probably looking for how to detect collisions between two rectangles, aka "Axis-Aligned Bounding Boxes" (AABB). Here's an article ...
- Sat Feb 16, 2019 6:01 pm
- Forum: Games and Creations
- Topic: snake12
- Replies: 6
- Views: 11494
Re: snake12
Nice, fun, simple game. Novel idea, good execution, I like it. I could only get 4 points, though. Also, you might want to consider adding a .love download for Linux and Mac users.
EDIT: New top score is 8
EDIT: New top score is 8
- Sat Feb 16, 2019 1:12 am
- Forum: General
- Topic: May love2d planned move to github?
- Replies: 20
- Views: 19696
Re: May love2d planned move to github?
I'd like to think the LÖVE community can have a proper discussion without resorting to personal attacks.
- Fri Feb 15, 2019 10:00 pm
- Forum: Support and Development
- Topic: Scenes/Views/Activities question [Answered]
- Replies: 27
- Views: 26661
Re: Scenes/Views/Activities question
OK, how's this: -- state.lua local state = nil local states = {} local State = { set = function (name) state = states[name] end, get = function () return state end } local function register(name, state) states[name] = state(State) end register("stateA", require "stateA") register...
- Fri Feb 15, 2019 9:27 pm
- Forum: Support and Development
- Topic: Scenes/Views/Activities question [Answered]
- Replies: 27
- Views: 26661
Re: Scenes/Views/Activities question
I'm not entirely sure what you mean by being "stuck with main.lua", or exactly what a "scene/view/activity manager" looks like to you. If you're looking for a way to swap out your love.update/love.draw/etc. functions, there's no magic here. Just make a table of the functions you ...