Search found 102 matches

by keharriso
Wed Feb 20, 2019 10:49 pm
Forum: Support and Development
Topic: UDP networking for multiplayer game
Replies: 30
Views: 22681

Re: UDP networking for multiplayer game

OK, I figured it out. You want to read ALL of the datagrams in the socket buffer instead of just one every tick. self.client.listen = function() data, err_msg = udp:receive() if data then --print("client: Received data: " .. data) self.buffer[#self.buffer + 1] = { msg = data, err = err_msg...
by keharriso
Tue Feb 19, 2019 10:17 pm
Forum: Support and Development
Topic: Love to stay open on error and give output to the VSCode output(or: How to set up Love for VScode)
Replies: 2
Views: 3454

Re: Love to stay open on error and give output to the VSCode output(or: How to set up Love for VScode)

Does messing with love.errorhandler or

Code: Select all

t.console = true
in conf.lua do anything? I don't actually use VSCode, so that's the extent of my ability to help here.
by keharriso
Tue Feb 19, 2019 10:07 pm
Forum: Support and Development
Topic: UDP networking for multiplayer game
Replies: 30
Views: 22681

Re: UDP networking for multiplayer game

You might have more luck getting help if you find some sort of minimal code necessary to reproduce the issue. If it's not relevant, take it out. Also, something runnable would be nice.
by keharriso
Tue Feb 19, 2019 9:00 pm
Forum: Support and Development
Topic: Video distortion/corruption on Raspberry Pi 3
Replies: 6
Views: 7696

Re: Video distortion/corruption on Raspberry Pi 3

I honestly have no idea what's wrong here, nor do I have a way to test/replicate your results. That being said:

1. Maybe it's a temperature issue?
2. Have you tried running the video in, say, VLC and seeing if it gets corrupted too?
by keharriso
Tue Feb 19, 2019 7:39 pm
Forum: Support and Development
Topic: How does scaling work?
Replies: 2
Views: 2532

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 ...
by keharriso
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: 12481

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.
by keharriso
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: 12481

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...
by keharriso
Sun Feb 17, 2019 6:35 pm
Forum: General
Topic: Coding Help
Replies: 8
Views: 5659

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 ...
by keharriso
Sun Feb 17, 2019 4:57 pm
Forum: Support and Development
Topic: How to delta time properly?
Replies: 3
Views: 4278

Re: How to delta time properly?

Correct me if I'm wrong, but wouldn't one of the simple friction equations be:

Code: Select all

player.xv = player.xv - friction * player.xv * dt
player.yv = player.yv - friction * player.yv * dt
Also, very nit-picky, but what you call "speed" seems to be acceleration.
by keharriso
Sat Feb 16, 2019 11:38 pm
Forum: General
Topic: Coding Help
Replies: 8
Views: 5659

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 ...