Search found 8 matches

by mathacka
Fri Jan 04, 2013 11:11 pm
Forum: Support and Development
Topic: How to make your character collide with terrain
Replies: 3
Views: 3015

Re: How to make your character collide with terrain

You need a collision function -- something that will compare two rectangles and see if they intersect, here's some pseudocode: Function Collision(x0,y0,w0, h0, x2, y2, w2, h2) If x0 > (x2 + w2) Or (x0 + w0) < x2 Then Return False If y0 > (y2 + h2) Or (y0 + h0) < y2 Then Return False Return true End
by mathacka
Fri Jan 04, 2013 9:56 pm
Forum: Support and Development
Topic: Object removal and destruction
Replies: 3
Views: 2325

Re: Object removal and destruction

This may be a bad idea, but I have an idea how you could test it. Put a large object in, something like: -- (10 meg) a[1024][10] get a RAM Monitor, remove/add/remove...the object and see if it's in and out. But I wouldn't have my computer running anything special so if it crashes or locks up/require...
by mathacka
Fri Jan 04, 2013 9:50 pm
Forum: Support and Development
Topic: Trouble with Line Intersection Code in Wiki
Replies: 4
Views: 2931

Re: Trouble with Line Intersection Code in Wiki

I tried changing your tolerance level to 0.00000001, and it still worked, I'm thinking the math functions they're using is producing some kind of floating point error at some places. I appears you can minimize your own error by putting in a tolerance lower then .01, but I don't know how much perform...
by mathacka
Fri Jan 04, 2013 9:36 pm
Forum: Support and Development
Topic: Trouble handling collision using Advanced Tiled Loader
Replies: 1
Views: 1881

Re: Trouble handling collision using Advanced Tiled Loader

I'm not entirely sure I understand the problem, could you attach a .love file? If the problem is finding a certain tile's x,y coordinates, couldn't you iterate through a loop in a load function and use that as the "map coordinates" for your collision reference?
by mathacka
Fri Jan 04, 2013 9:30 pm
Forum: Support and Development
Topic: C++ Map Maker
Replies: 1
Views: 1545

Re: C++ Map Maker

I'm not sure I'm understanding your question, in what way will you be using c++, why couldn't you use a (*.txt) file and then input the parameters you need like:

inside the (*.txt) file

Code: Select all

blocknum: 1
image: 3
pos: 32 32
collidable: 1

blocknum: 2
image: 2
pos: 64 0
collidable: 0
by mathacka
Fri Jan 04, 2013 9:25 pm
Forum: Support and Development
Topic: Debugging a crash?
Replies: 9
Views: 6685

Re: Debugging a crash?

Make or go to your config.lua file and add

Code: Select all

t.console = true
then print out what variables you need to see, for instance:

Code: Select all

print("Collision Function: " .. CollisionFunction( x,y,w,h,x2,y2,w2,h2 ) )
by mathacka
Fri Jan 04, 2013 9:19 pm
Forum: Support and Development
Topic: Need help with jump cooldown
Replies: 1
Views: 1376

Re: Need help with jump cooldown

Correct me if I'm wrong, but wouldn't it be:

Code: Select all

velX, velY = player.body:getLinearVelocity()
-- Then just use the velY
?
by mathacka
Wed Oct 17, 2012 7:19 pm
Forum: General
Topic: Sublime Text 2 Plugin for Love 2d
Replies: 3
Views: 3217

Sublime Text 2 Plugin for Love 2d

Hi, I just made a comprehensive sublime text 2 plugin for love 2d it can be found at: "https://github.com/mathacka/sublime_love2d_plugin" just download the zip and install the plugin it has love2d keywords, like types and enums, as well as code completion for all the functions tell me how ...