Search found 2 matches

by josephpayne
Tue Nov 14, 2023 9:05 am
Forum: Ports
Topic: love.js web game crash page refresh emscripten
Replies: 3
Views: 34721

Re: love.js web game crash page refresh emscripten

Hello, The error message you're seeing is from Emscripten, the tool that is used to compile Love2D (and many other things) to JavaScript so it can run in a web browser. What it's saying is that you're trying to set up a new game loop while an old one is still running. When you refresh the page, your...
by josephpayne
Tue Nov 14, 2023 9:01 am
Forum: Ports
Topic: please explain these lines of code
Replies: 5
Views: 53524

Re: please explain these lines of code

In the love.graphics.draw() function, (self.orientation == 'top' and self.y + PIPE_HEIGHT or self.y) is not returning true or false, but rather it's using Lua's version of a ternary operation. This can be read as: If self.orientation equals 'top', then use self.y + PIPE_HEIGHT, else use self.y. This...