Tag Info

Hot answers tagged

6

Well tweening in the general case is just parametric movement (specifically, defining a function f(x) where x can be 0..1 for position/rotation/scale/whatever) with a modifier on the parametric value you pass in. The modifier also has the range 0..1. If you plot the algorithm on a graph you'll get something that starts at 0, ends at 1, and the slope of the ...


4

I've written a primer on interpolation, which may be of some use - http://iki.fi/sol/interpolation/ Another great resource is this interactive tool: http://www.gizma.com/easing/


4

It is called a barycentre. Here your point is: P = (A * A_ratio + B * B_ratio + C * C_ratio) / (A_ratio + B_ratio + C_ratio) Badly, Wikipedia have no dedicaced page for this, so you'll have to understand the explanation of center of mass, which is just a generalization of barycentres applied to physics. EDIT: your second method is equal to: P - default ...


3

I have got it working now! I just missed one vector difference and one multiplication. here is the code: function moveFocused( center, bbox ){ var moveData; if( ! this._animationData.hasOwnProperty( 'moveFocus' ) ){ this._body.SetLinearVelocity( new b2Vec2() ); setBodyType.call( this, b2Body.b2_kinematicBody ); var m = ...


3

The problem seems to be that if i create a list of Tweens, then call update, it uses Tweens implementation of Tween.update() and not it's inherited children, I don't know how/if it's possible to allow this... Of course it's possible, that's the whole idea of polymorphism. You just need to ensure two things: 1) Mark the Update method as virtual in your ...


3

I fail to see what's the problem you're having. Update the time of day and tween the colors in the Update method (assuming it has access to the dt) and leave the Draw method only for rendering. I think that's the more logical solution. Also, encapsulate this in some sort of Sky class if you haven't done so already. So I'd definetly stick to the 2nd option. ...


3

That type of control scheme is totally useless as you will overload the players with information and at least the reaction time will suffer considerably,that is why mouse is preferable since a lot of variation can be made If you want variety in animation you don't need convoluted controls schemes, you can use either procedural animations and/or blend ...


2

Take a look at the Grapefrukt Exporter library.


2

From what you describe, your problem is probably relative to the movie-clip you are targeting to test collisions with. To be more precise, I think you are testing your collisions against the movie-clip containing the enemy animation and the enemy graphics. But indeed this movie-clip doesn't move at all... it's fixed and only its content is moving (well at ...


2

I solved it! I forgot to add this code at the render() method: Tween_Manager.update(delta); // --> Set update to enable animation changes.


2

Your problem is that you are using t and moving the time forward, in a parametric equation t represents any varying quantity and that doesn't strictly mean you should move the time forward. This can be simply achieved by writing an interpolation in a loop and increment t just at initialization time. // call this at initialization time int stepsCount = 10; ...


2

This is simply a combination of a few simple steps. First, get the mouse position, Gdx.input.getX() will give you the mouse X position. You'll want to get that position at the time the mouse button was pressed. Now, that you have a target, move your hero towards it. You can do that with something like: float deltaV = deltaTime * speed; if ...


1

This is just speculation: Maybe you forgot to call act() on your Stage that has all the Actors. Actions are updated per frame through the act() method on each Actor which is called by Stage's act(). public void render () { Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); stage.act(Gdx.graphics.getDeltaTime()); stage.draw(); } From ...


1

When dealing with splines, how your interpolation works at a point is determined by the continuity of the spline at that location. This will vary depending on the type of spline you are using but at the very least you want your incoming and outgoing tangents to have the same direction at point A. If you make sure the tangents are also the same length at ...


1

You haven't shown any code, so I don't know for sure but I think your sprites have an origin that lies in the middle of it. Here is how the actual sprite is created in model space: As you can see we have 4 vertices at each corner. This makes our quad and we texture map it with the sprite we want. The important thing to note here is that the origin is in ...


1

A standard "tween" algorithm usually works by simplifying a more general hermite spline function, to eliminate the necessity of manually providing initial and terminating velocity values. But if you wish to be able to switch from one tween to another, you can no longer do that, and you'll need to use a full, non-simplified spline calculation. Here's some ...


1

I've had issues with the Tween library and I usually find I have to eliminate variables and until it works and then add them back in. Some things to try: Did the animation work before you added repeatYoyo? Did you mean to set the Alpha to 3? Usually this ranges from 0 to 1. Did you try it without any easing? Good Luck!


1

Calculate the relative offset from Default to each point and add them on top of Default with the given weights. This means that you can't divide by the sum of the weights unlike in the previous answer you got. deltaA = A - Default; deltaB = B - Default; deltaC = C - Default; point = Default + deltaA * weightA + deltaB * weightB + deltaC * weightC;


1

I'm under the impression AS3 is a retained-mode API. You create a collection of objects - it draws and manages them for you. XNA, on the other hand, is an immediate-mode API. You are responsible for drawing things each frame, reading inputs each frame, keeping track of time, and so on. Here is a complete game class to demonstrate what you want. Just paste ...


1

Well... the reason there's a moves list is because each "attack" has to do SOMETHING. Limiting the options does limit the gameplay but it also limits players from being overwhelmed and it limits the chances of something obscenely overpowered sneaking in. If the "something" for the attack is, for example, a slash attack but one varies one degree from ...



Only top voted, non community-wiki answers of a minimum length are eligible