Search found 2 matches

by bartexsz
Sat Aug 25, 2012 9:53 pm
Forum: Support and Development
Topic: fixed point math problem
Replies: 4
Views: 2082

Re: fixed point math problem

I had small problems with adjusting your code to my further needs, however, it showed me that I forgot about counting object->mouse vector. Although i reviewed my needs, and came to conclusion that i need only: -- counting vector object.speedx = dx object.speedy = dy btw. isn't dt constant(without t...
by bartexsz
Sat Aug 25, 2012 2:19 pm
Forum: Support and Development
Topic: fixed point math problem
Replies: 4
Views: 2082

fixed point math problem

Simple, I want ball to follow mouse. However with this code: if (objects.mainchar.speedx < objects.mainchar.maxspeedx and mousepos.x > objects.mainchar.x + 62) then objects.mainchar.speedx = objects.mainchar.speedx + mousepos.x/math.sqrt(mousepos.x*mousepos.x+mousepos.y*mousepos.y)/2 end if (objects...