Search found 10 matches

by josephjohn
Fri Sep 28, 2018 9:21 pm
Forum: Support and Development
Topic: Reducing packaged game size
Replies: 3
Views: 5258

Reducing packaged game size

I've been trying to reduce my game size for a month now, and have finally managed to get it under 100kB. But after packaging it, it ends up being about 4MB, which is way too much.

It there any way to get the engine + game to under 1MB?
by josephjohn
Thu Dec 28, 2017 7:00 pm
Forum: Support and Development
Topic: Collision problem
Replies: 3
Views: 2308

Re: Collision problem

Perhaps the quickest way to resolve this is to start from the direction the objects are moving towards. Eq. if the objects are moving towards right, update the right-most object first, the second right-most second, etc. Thus if the first one moving to the right gets blocked, it could signal the one...
by josephjohn
Thu Dec 28, 2017 4:14 pm
Forum: Support and Development
Topic: Collision problem
Replies: 3
Views: 2308

Collision problem

I am making a tile-based game where you can select multiple units and have them move. This is where the problem is. I have it set so that when you press "d", all the selected units move right. But if the placement is like this: we have the units positioned like: XXXO, where X is a unit and...
by josephjohn
Sun Dec 17, 2017 10:11 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

Thanks, works now!
by josephjohn
Sun Dec 17, 2017 6:00 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

Here you go, quick and dirty: function love.load() love.mouse.setVisible(false) lAngle = -90 dAngle = 0 end function love.draw() love.graphics.setColor(255, 255, 255, 255) love.graphics.ellipse("fill", mX, mY, 4, 4) love.graphics.ellipse("fill", 400, 200, 10, 10) love.graphics.s...
by josephjohn
Sun Dec 17, 2017 5:49 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

mr_happy wrote: Sun Dec 17, 2017 5:26 pm atan2 takes (y, x)
I know, that's why im inpitting tryY - y and tryX - x
by josephjohn
Sun Dec 17, 2017 5:06 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

Does it rotate the 'long way round' when your mouse is any quadrant? Sounds to me like you just need to get the signs right depending upon which quadrant the cursor is in. If you look at the output of atan2 using something like this you'll see what's required: radius = 100 for i = 0, 359 do x = rad...
by josephjohn
Sun Dec 17, 2017 4:33 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

There's something wrong with your diagram (or understanding, and I don't mean that in a nasty way) - there are 2PI radians (call it 6 and a bit radians) in 360% so "-3 to 3" is almost a complete rotation. As I said before, atan2 will help you fix the issue - here's a good explanation: htt...
by josephjohn
Sun Dec 17, 2017 3:41 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

Re: rotation question

I might have explained it wrong. The problem is this: I have a sprite, which rotates towards the mouse when I click. I works great when going from 1rad to 2rad, or from 1 rad to -1 rad, but when it goes from -3rad to 3rad, it rotates around the larger angle, so instead of going from -3rad to 3rad by...
by josephjohn
Sat Dec 16, 2017 8:38 pm
Forum: Support and Development
Topic: rotation question
Replies: 20
Views: 13616

rotation question

So I have a piece of code to slowly rotate a sprite towards the mouse position, and it works. However, when it has to rotate from negative to positive (3.1 to -3.1) and vice-versa, it does a full rotation around. How can I make sure it rotates in the shortest distance instead of a full rotation?