Search found 1911 matches

by ivan
Fri May 08, 2015 7:56 pm
Forum: General
Topic: Number questions
Replies: 9
Views: 4282

Re: Number questions

Code: Select all

if math.floor(number) == number then
  -- is integer
else
  -- non-integer
end
There may be some robustness issues of course but it should work as
long as the number is not very large or small.
by ivan
Fri May 08, 2015 4:56 am
Forum: Libraries and Tools
Topic: Chess.lua
Replies: 14
Views: 14152

Re: Chess.lua

Thanks so much for taking a look.
I know a few people on here have programmed chess in Lua.
So I'm open to suggestions on improving the code
in particular with the '10x12 mailbox' and perhaps even the board representation.
Seems like the 'mailbox' approach is more suited for non-interpreted languages.
by ivan
Tue May 05, 2015 8:17 am
Forum: Support and Development
Topic: Check collisions of an object with multiple same objects?
Replies: 1
Views: 843

Re: Check collisions of an object with multiple same objects

Hello, Redsled. I think your question could be rephrased because laying out N number of rooms of predefined sizes in a given area is much more complex than an algorithm that partitions a given area into arbitrary rooms. So I would say, try something that partitions the area without testing for inter...
by ivan
Mon May 04, 2015 4:51 pm
Forum: Support and Development
Topic: Physics engine not working???
Replies: 8
Views: 4164

Re: Physics engine not working???

From what I can see, they are bouncing off each other. However, there's a plethora of things you have to tweak to make it look like 'real' billiards. For the edges of the board, you can place 4 static rectangles on each side or use a "chain" shape. Oh ya, make your billiard balls 'bullets'...
by ivan
Mon May 04, 2015 1:31 pm
Forum: Support and Development
Topic: Physics engine not working???
Replies: 8
Views: 4164

Re: Physics engine not working???

In your code it's

Code: Select all

world.w = love.physics.newWorld(0, 0, false)
so

Code: Select all

world.w:update(dt)
and add dt to:

Code: Select all

function love.update(dt)
by ivan
Mon May 04, 2015 11:55 am
Forum: Support and Development
Topic: Physics engine not working???
Replies: 8
Views: 4164

Re: Physics engine not working???

world.w = love.physics.newWorld(0, 10, true) first two arguments are the gravity vector (0, 10) means vertical gravity of 10m/s^2 in overhead games it should be (0, 0) "ture" as the third argument means, "yes allow inactive bodies to 'sleep' and not be updated" set this to "...
by ivan
Mon May 04, 2015 9:17 am
Forum: Support and Development
Topic: Physics engine not working???
Replies: 8
Views: 4164

Re: Physics engine not working???

If a particular body isn't moving it could be one of several things: 1.make sure the body type is "dynamic" 2.make sure all fixtures on the body have a density > 0 3.make sure the body's linear/angular damping is in reasonable range. set it 0 for debuging purposes 4.make sure the body is '...
by ivan
Mon May 04, 2015 7:16 am
Forum: Support and Development
Topic: Maths questions if anyone can help a brother out
Replies: 5
Views: 2130

Re: Maths questions if anyone can help a brother out

For 45-degrees, you can just rotate the point math.pi/2, no scaling/skewing involved. As I said, there are different types of isometric layouts (diamond, staggered, etc). Generally speaking you could probably get away with something like: screenX, screenY = ... -- get mouse coords -- screen coords t...
by ivan
Mon May 04, 2015 6:34 am
Forum: Support and Development
Topic: Maths questions if anyone can help a brother out
Replies: 5
Views: 2130

Re: Maths questions if anyone can help a brother out

I assume you mean converting a point to an index in an 'isometric' projection and vice versa. Interestingly, with a lot of isometric games the tilt angle is 30 degrees not 45. Take a look at the bottom of this page: http://2dengine.com/doc_1_3_10/gs_isometric.html It shows you how to convert the poi...
by ivan
Sun May 03, 2015 3:12 pm
Forum: General
Topic: grid based block interaction
Replies: 4
Views: 2636

Re: grid based block interaction

putting tht it actual blocks. so really, its to have these walls within a grid based 1 & 0 type method. movaeble blocks would be something for the future, but just to start off small im just looking for the player to stop once hitting a wall If you're going for action-based gameplay like in the...