Stencyl 3.4.0 is now out. Get it now!

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.


Messages - LIBERADO

Pages: 1 2 3 ... 156
1
My formula:
Code: [Select]
class MoveAlongBezierCurve {

public static function moveAlongBezierCurve( a:Actor, x2:Float, y2:Float, cx:Float, cy:Float, t:Float, e:motion.easing.IEasing) {
var x1:Float;
var y1:Float;
var tempX:Float;
var tempY:Float;
var tempCX:Float;
var tempCY:Float;
x1 = a.getX();
y1 = a.getY();
tempX = Math.round(((x1 + x2) / 2));
tempY = Math.round(((y1 + y2) / 2));
tempCX = (tempX + ((cx - tempX) * 2));
tempCY = (tempY + ((cy - tempY) * 2));
a.activePositionTweens++;
a.tweenLoc.x = a.getX(false);
a.tweenLoc.y = a.getY(false);
var path = new MotionPath().bezier (x2, y2, tempCX, tempCY);
Actuate.motionPath (a.tweenLoc, t, { x: path.x, y: path.y }).ease(e).onComplete(a.onTweenPositionComplete);
}
}

4
I added a pull request before yoplala solved this issue to integrate bezier movement of actors directly into the engine, so if it gets accepted it will be in the beta version of stencyl :)
That would be fantastic.

By the way, with the default formula the actor never reaches the control point. This does not seem suitable to me. I have added some maths to get the actor to always reach the control point, so I can have a better control of its position.


5
Thanks to your help I have made an extension:
   
<a href="http://static.stencyl.com/games/37954-0.swf" target="_blank" class="new_win">http://static.stencyl.com/games/37954-0.swf</a>
   
I really need beautiful bezier curves because I was tired of sliding actors in boring straight lines only.

6
Tested on Google Chrome and works well.

7
Use these blocks appropriately: 

8
Ask a Question / Re: Animation only playing first frame
« on: Yesterday at 01:35:46 pm »
As far as I know, what you are telling is not possible.
Can you upload a project file that we can download to test the issue?

9
Ask a Question / Re: Player collision not working
« on: Yesterday at 11:26:01 am »
Simple Physics works only with square collision shapes.

10
iPhone / iPad / Android / Re: Big Shot Boxing
« on: Yesterday at 05:04:12 am »
Nice and smooth movement of the punches. I guess you have used the Joints extension, or maybe the Spine Skeleton extension. In any case, great game, very addictive. Congratulations.

11
Ask a Question / Re: How to make a collision system based on color?
« on: December 09, 2017, 04:31:04 pm »
Opposite  direction of the perpendicular. Does that makes sense to you?
Yes. I think it is important to consider what merrak has said.

12
Ask a Question / Re: How to make a collision system based on color?
« on: December 09, 2017, 03:25:40 pm »
Once the character overlaps the red area, you want it to bounce... in what exact direction?

13
Ask a Question / Re: How to make a collision system based on color?
« on: December 09, 2017, 03:02:25 pm »
If the black area is a perfect circle, you could use maths.

14
Ask a Question / Re: How to make a collision system based on color?
« on: December 09, 2017, 02:43:35 pm »
Why don't you want to use terrain or collision boxes?

15
Ask a Question / Re: Who helps me with this block of logic?
« on: December 09, 2017, 02:22:50 pm »

Pages: 1 2 3 ... 156