Search found 587 matches

by grump
Tue May 07, 2019 8:48 pm
Forum: Support and Development
Topic: random number without duplicate [SOLVED]
Replies: 6
Views: 1049

Re: random number without duplicate

An actually working and simple solution is to create a list of all possible values, select one randomly, then delete the selected entry from the list of possible values.

A more sophistacted approach is a Feistel network, more practical information here.
by grump
Sun Apr 28, 2019 9:18 am
Forum: Support and Development
Topic: [anim8] attempt to call method draw (nil value) [SOLVED]
Replies: 3
Views: 716

Re: [anim8] attempt to call method draw (nil value)

The code snippet you posted is different from the actual code in the love file.

The actual fix is calling player.animation:draw (not animations).
by grump
Fri Apr 26, 2019 7:35 pm
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 13548

Re: Collision detection without physics?

I would not like to use graphics functions for collision detections. Graphics functions can only run from the main thread, so this would be a limitation, should I choose to separate update from drawing. In the end I think I will just go for a simple getPixel(x,y) to see if the middle of the car is ...
by grump
Fri Apr 26, 2019 7:21 pm
Forum: Support and Development
Topic: Help about my code [SOLVED]
Replies: 3
Views: 909

Re: Help about my code

The most glaring error is that you did not ask a real question. At least have the courtesy to mention what error you're trying to solve and how it differs from the expected result. And if possible at all, please post something that can be analyzed with minimum effort. A love file that shows the erro...
by grump
Mon Apr 15, 2019 10:33 am
Forum: Support and Development
Topic: [bump.lua] world:remove doesn't work
Replies: 6
Views: 6278

Re: [bump.lua] world:remove doesn't work

You're creating a new 'test' table every time love.keypressed is called, and the one you've added before is lost. This should work: local test = { x = 0, y... } -- outside the function! function love.keypressed(key) if key == "c" then world:add(test,test.x,test.y,test.w,test.h) end if key == "d" the...
by grump
Thu Apr 11, 2019 9:30 pm
Forum: Support and Development
Topic: Canvas Messing Up Colors
Replies: 2
Views: 3979

Re: Canvas Messing Up Colors

Everything you draw is modulated by the current color. Try love.graphics.setColor(1, 1, 1) before drawing the canvas.
by grump
Thu Apr 11, 2019 9:29 pm
Forum: Support and Development
Topic: Networking between devices on the same wifi connection
Replies: 7
Views: 6246

Re: Networking between devices on the same wifi connection

Could it have something to do with my router? Assuming that you're talking about an actual router, and not some kind of local firewall - probably not. The task of a router is to connect different networks. "Opening a port" on the router exposes your local network to the Internet for connections on ...
by grump
Tue Apr 02, 2019 9:06 pm
Forum: Support and Development
Topic: Error: Cannot compile vertex shader code
Replies: 2
Views: 1326

Re: Error: Cannot compile vertex shader code

FWIW, I could not solve this error. But it does not happen on a Windows 10 system, so I just decided to forego testing on Windows 7 altogether. Try updating your graphics drivers if that's an option.
by grump
Tue Apr 02, 2019 9:00 pm
Forum: Support and Development
Topic: UDP networking for multiplayer game
Replies: 30
Views: 6594

Re: UDP networking for multiplayer game

Send a UDP message to 255.255.255.255, i. e. send a broadcast message. All devices listening on the same network on that destination port will receive it and can respond to it.

Edit: it's a little bit more complicated for IPv6, but not by much. Please support IPv6 ;)
by grump
Wed Mar 27, 2019 11:09 am
Forum: Support and Development
Topic: Error: attempt to index field 'connected_sticks' (a nil value)
Replies: 1
Views: 1113

Re: Error: attempt to index field 'connected_sticks' (a nil value)

Welcome!

main.lua line 84 says GPM:button, but you probably meant to write gpm:button.