Search found 9 matches

by JimOfLeisure
Thu Jan 13, 2022 8:36 am
Forum: Support and Development
Topic: How to program action game in a wrapping world? (2D torus)
Replies: 15
Views: 6540

Re: How to program action game in a wrapping world? (2D torus)

ReFreezed wrote: Wed Jan 12, 2022 11:32 pm Shaders really are quite amazing. They can do anything. Absolutely anything.
OMG that got painful. He could have probably done it with shaders, though. Making 7 perpendicular red lines with blue and transparent ink is child's play in shaders. And 4-5 extra dimensions.
by JimOfLeisure
Wed Jan 12, 2022 8:03 pm
Forum: Support and Development
Topic: How to program action game in a wrapping world? (2D torus)
Replies: 15
Views: 6540

Re: How to program action game in a wrapping world? (2D torus)

You could alternately allow the player and enemies to have infinite coordinates and relocate parts of the map. The map would always have to be bigger than the viewport, of course. If you need e.g. long-tailed enemies to wrap around, their tails could be drawn with a modulus function, but if you need...
by JimOfLeisure
Wed Jan 12, 2022 6:08 pm
Forum: Support and Development
Topic: Challenge rotating around a point
Replies: 12
Views: 5365

Re: Challenge rotating around a point

You move the coordinate system instead of the object, basically; the result of that first transform is going to be that (0,0) will be at the point of rotation; since the rotate function rotates around (0,0), it will now work fine. I guess I was thinking subsequent translate and rotate statements we...
by JimOfLeisure
Wed Jan 12, 2022 6:23 am
Forum: Support and Development
Topic: Challenge rotating around a point
Replies: 12
Views: 5365

Re: Challenge rotating around a point

function camera:set(angle) push() translate(x_offset,y_offset) rotate(-(angle - (math.pi / 2))) translate(-self.x, -self.y) end You were close :) Thanks! That did it! It makes sense now that I/you did it, but that seems completely backwards from what I originally expected. That does exactly what I ...
by JimOfLeisure
Tue Jan 11, 2022 3:38 am
Forum: Support and Development
Topic: Challenge rotating around a point
Replies: 12
Views: 5365

Challenge rotating around a point

I see this is a common question, and I've looked at the wiki and a bunch of forum posts, but for some reason I can't figure this out. This is a physics simulation where a ball rolls down a bumpy hill, and the viewer can change the angle of the hill. But really the ground is level, and only a camera ...
by JimOfLeisure
Fri Dec 31, 2021 10:50 am
Forum: Games and Creations
Topic: First project: "Bumpy Road" ball racer
Replies: 0
Views: 9873

First project: "Bumpy Road" ball racer

I started with the physics tutorial to familiarize myself with the physics and wanted to use noise to generate something in a game continuously. I wound up with Bumpy Road, or maybe I should have called it Bumpy Hill. It's just a ball rolling down a hill, but if it bounces too high it deploys a para...
by JimOfLeisure
Fri Dec 31, 2021 10:36 am
Forum: Ports
Topic: In Love.js, can Lua functions be called from JS?
Replies: 4
Views: 16321

Re: In Love.js, can Lua functions be called from JS?

It's definitely not a "best practice". If I pursue the idea I'll probably just do it all in JS or something that compiles to WASM so I can explicitly export functions. The URL thing is very interesting, though. I've been using the Davidobot Love.js so far; I just found out about yours and ...
by JimOfLeisure
Thu Dec 30, 2021 8:37 pm
Forum: Ports
Topic: In Love.js, can Lua functions be called from JS?
Replies: 4
Views: 16321

In Love.js, can Lua functions be called from JS?

Hi, I think this is possible, but I'm not sure how easy or hard it is, so I thought I'd ask in case anyone else knows already. If I define a function in the game that isn't called, can I call it from JavaScript after exporting to web with Love.js ? I made the example below as a test for the idea. Ca...
by JimOfLeisure
Wed Dec 29, 2021 9:45 pm
Forum: Support and Development
Topic: (Solved) I can't get Body:setAngularVelocity() working
Replies: 0
Views: 8741

(Solved) I can't get Body:setAngularVelocity() working

Hi, I'm quite new to Love2d and am making a little prototype / game for a game jam for fun and glory. The code in question: https://github.com/JimOfLeisure/bumpy-road-love2d/blob/27fe341440bfa4cdbc5462981b330367b7a7f5bc/src/ground.lua#L17 I have physics circle falling onto a physics rectangle called...