Search found 59 matches

by chezrom
Wed Sep 04, 2013 12:30 pm
Forum: Support and Development
Topic: Thrust in Box2D
Replies: 5
Views: 3864

Re: Thrust in Box2D

For example : body:applyForce(body:getWorldVector(local_fx,local_fy)) The force is applied to the centre of mass, as show in your drawing. You can have, if your thrust is directed down so the reaction force is up local_fx = 0 and local_fy= - gravity * factor You must call applyForce at each update w...
by chezrom
Wed Sep 04, 2013 12:10 pm
Forum: Support and Development
Topic: Thrust in Box2D
Replies: 5
Views: 3864

Re: Thrust in Box2D

Sorry vrld for your hump.vector library, but Box2D has this functions ... You can use body:getWorldVector(local_x,local_y) => world_x,world_y to transform a vector is the body/local coordinate to the world coordinate. The local vector is simple to determine because your square shape is always aligne...
by chezrom
Mon Sep 02, 2013 4:26 pm
Forum: Support and Development
Topic: Objects fall through each other?
Replies: 5
Views: 1946

Re: Objects fall through each other?

Yes, in fact all the coordinates of the shapes is relative to the origin of the attached body, and the position of the body is the coordinate of this origin in the world coordinate (the screen coord). A rectangle is defined by the position of its center and its width and height. We need the body ang...
by chezrom
Mon Sep 02, 2013 4:16 am
Forum: Support and Development
Topic: Objects fall through each other?
Replies: 5
Views: 1946

Re: Objects fall through each other?

The problem is that for the physic engine a rectangle is centered, so the body position is the centre of your rectangle not the top left corner. another problem, you ignore the body rotation when displaying it. you must draw rotated box. EDIT : Here a version that work (I use image for drawing your ...
by chezrom
Mon Sep 02, 2013 3:09 am
Forum: General
Topic: __ and Functions
Replies: 7
Views: 1901

Re: __ and Functions

the lua reference manual explains all the __ functions : meta-tables
the explanations here are clear and worth the effort to read.
by chezrom
Sun Sep 01, 2013 9:46 am
Forum: General
Topic: helps animation to walk in a rpg game. - (Solved)
Replies: 3
Views: 3383

Re: helps animation to walk in a rpg game.

The first problem I see is the love.timer.sleep in the player.update function. You don't need that and it kills your frame rate because the main loop (the love.run function) call love.update and then the love.draw function. The second problem is that you add your speed (32), so the sprite teleport a...
by chezrom
Fri Aug 23, 2013 7:57 am
Forum: General
Topic: Overllaping matrices
Replies: 13
Views: 7756

Re: Overllaping matrices

Your code do in fact an intersection of two sorted arrays, ie produces an array with the common values.
intersect([1,2,3,4],[2,4,6])=[2,4]

For me, a matrix is a 2D arrays, and I must admit that I don't know what is a "matrix intersection"

EDIT : Oups, vrld is faster than me
by chezrom
Sun Aug 11, 2013 9:38 pm
Forum: Support and Development
Topic: [Question] GLSL to LÖVE
Replies: 5
Views: 2836

Re: [Question] GLSL to LÖVE

In fact löve has already defined main function. The shader is defined with a function "vec4 effect( vec4 color, Image texture, vec2 texture_coords, vec2 screen_coords )" You must adapt the code to enter in this frame. gl_FragCoord.xy becomes screen_coords. And gl_FragColor is in fact the r...
by chezrom
Sun Aug 11, 2013 1:13 pm
Forum: Support and Development
Topic: angle between two points + more
Replies: 3
Views: 6624

Re: angle between two points + more

If I understand well, your problem is to rotate a vector by a certain angle. You don't need to know the initial angle to do that. The vector you want to rotate is (a-x = u;b-y =v) targeted the enemy from the player, the "error" angle is alpha (-5 to +5 degrees in your case), so the rotated...
by chezrom
Sat Aug 10, 2013 6:21 pm
Forum: Libraries and Tools
Topic: Lövely NET - A Very Simple HTML Browser [v2]
Replies: 17
Views: 7912

Re: Lövely NET - A Very Simple HTML Browser

It is slow because at each draw you do a http request ... Do only one request per url and store it.