First of all, have been building a game using the WCK and after a while of playing around and adding new things in the parameters that can be changed for each ofthe bodies within the properties/component definitions have stopped working as well as being unable to change them as the changes do not save once you apply.
For instance, if I wish to change the density of a block (whether its from the original or an instance of it) once it is changed and the game runs the changes that have been made are reversed. I was just wondering if this is a known issue? (as well as whether anyone knows how to sort this out) as this is highly impacting the way that the game will be running as we need change the parameteres for different things.
Secondly, I have it so that different objects spawn at a random point along the top of the screen, but at the moment they just drop once spawned and I was wondering how to go about applying forces to them once spawned so that they will fly off it different directions instead of just dropping vertically down (I know this could be done via the parameters but as stated above, I am unable to change them and keep the changes)
This is the code that I currently have for the spawning of the "projectiles":
And I am wondering how to include the following section of code (I think it is the right one) to apply a force to it to send it in a different direction other than vertically down? I know its a pretty vague explanation but I cnat think how else to explain it.
Any help would be greatly appreciated and feel free to inbox me/post here if you need any other information as im not 100% as to what code I needed to include to get my point accross 🙂
For instance, if I wish to change the density of a block (whether its from the original or an instance of it) once it is changed and the game runs the changes that have been made are reversed. I was just wondering if this is a known issue? (as well as whether anyone knows how to sort this out) as this is highly impacting the way that the game will be running as we need change the parameteres for different things.
Secondly, I have it so that different objects spawn at a random point along the top of the screen, but at the moment they just drop once spawned and I was wondering how to go about applying forces to them once spawned so that they will fly off it different directions instead of just dropping vertically down (I know this could be done via the parameters but as stated above, I am unable to change them and keep the changes)
This is the code that I currently have for the spawning of the "projectiles":
Code:
function handleResetTimer(e:TimerEvent):void
{
var p:Point = new Point((Math.random()*this.width)-this.width/2,-350);
trace("spawned!!!!")
Util.addChildAtPos(this, new MeteorClass(), p);
trace("Timer Reset");
t.reset();
t.start();
}
{
var p:Point = new Point((Math.random()*this.width)-this.width/2,-350);
trace("spawned!!!!")
Util.addChildAtPos(this, new MeteorClass(), p);
trace("Timer Reset");
t.reset();
t.start();
}
And I am wondering how to include the following section of code (I think it is the right one) to apply a force to it to send it in a different direction other than vertically down? I know its a pretty vague explanation but I cnat think how else to explain it.
Code:
public function ApplyForce(force:V2, point:V2):void
{
SetAwake(true);
m_force.x += force.x;
m_force.y += force.y;
m_torque += V2.subtract(point, m_sweep.c.v2).cross(force);
}
{
SetAwake(true);
m_force.x += force.x;
m_force.y += force.y;
m_torque += V2.subtract(point, m_sweep.c.v2).cross(force);
}
Any help would be greatly appreciated and feel free to inbox me/post here if you need any other information as im not 100% as to what code I needed to include to get my point accross 🙂