Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Pages: 1
1
Ludum Dare 28 / One Strike
« on: January 05, 2014, 02:46:22 pm »
Hello guys, how you're doing?

This was my entry for LD28, One Strike

http://www.ludumdare.com/compo/ludum-dare-28/?action=preview&uid=22127

I didn't want to make any complex mechanic, in fact, since I work with Stencyl on a daily basis the mechanic was up and running in a few minutes. However I made a couple of bad moves, like not getting familiar with After Effects before the LD. Tell me what you guys think of it!

Also, the post-mortem is here: http://www.ludumdare.com/compo/2013/12/27/one-strike-post-mortem/

2
Ask a Question / Re: Path predicting (sorta)
« on: June 06, 2013, 11:29:39 am »
Everything is working fine now, thanks for your input once again, cole. Gonna add those considerations about box2d/stencyl physics on my dev team wiki.

3
Ask a Question / Re: Path predicting (sorta)
« on: June 04, 2013, 06:46:42 pm »
Thanks for the quick response, cole. Tomorrow I will try it once again and, hopefully, post legit results.

4
Ask a Question / Path predicting (sorta)
« on: June 04, 2013, 05:45:14 pm »
Hey guyse, how you're doing? Well, for the past two days I've been running in circles trying to do one thing: move an actor from A(red) to B(green), like in the image below (pretend that the blue path is a parabola, sorta)

Well, I've had everything, the initial position, the final position, the time needed for doing the path (lower times would make it closer to a straight line), the gravity, I just had to put all that on the formula to find the initial velocity. Right? Apparently, not. After some searching about box2d physics, I've came across this

http://www.iforce2d.net/b2dtut/projected-trajectory

And learned a bit about box2d not using continous time (which makes sense), that box2d use meters, converting meters into pixels, etc. And got a new formula, everything should work now, right? Apparently, not. Let's assume that we have one actorA (placed on point A) and an actorB (placed on point B). I wanna toss A on B's head, in a way that, no matter from what distance I throw A, by finding the velocity for doin that, A will ALWAYS land exactly over B's head. I've did the maths for distance, for time steps, for step gravity, conversions and used the formula provided on the link above in order to find the velocity. But still, if I vary the deltaX between A and B, A will miss B by a few pixels, there are just few spots where it is a hit. What am I missing? I've got everything wrong about box2d and its physics on Stencyl?

Oh, here is some code (please, ignore orientation, I already handle that on my actual code, that is just a sample of what maths I'm doing)

Code: [Select]
` _steps = _time*getFPS(); _t = 1/getFPS(); _DeltaX = (actorB.getX() - actorA.getX())/30 ; _DeltaY = (actorB.getY() - actorA.getY())/30; _velocityx = (_DeltaX - (((_steps*_steps + _steps)*((getGravity().x)*_t*_t))/2))/(_t*_steps); _velocityy = (_DeltaY - (((_steps*_steps + _steps)*((getGravity().y)*_t*_t))/2))/(_t*_steps); actorA.setXVelocity(_velocityx); actorA.setYVelocity(_velocityy);`

Pages: 1