Sushin's Forum Posts

  • Hi.

    So I'm basically trying to get my camera to smoothly move towards the center of the position between the character and the mouse pointer. This is the code I wrote for it.

    <img src="http://puu.sh/2p5tr.jpg" border="0" />

    This works fine but it's not smooth at all. I was experimenting with movement a bit, but it's not working well. Anyone have tips?

    Additionally, how can I alter the equation I wrote to make the camera appear closer to the player instead of at the halfway point? Like perhaps 1/3rd of the way between the player and the camera.

  • It's the collision boxes. It's using accurate collisions, and every accurate collision for each animation has a different point where it meets the bottom, so you get a vibrating effect as the animation plays.

  • you could check if the object is overlapping whatever object you don't want it to spawn in. if that happens, delete it and respawn it again.

  • Without blasted drag and drop, can someone explain to me the best way to pick up an object with the mouse pointer, move it over some distance, and drop/throw it by letting go of the click?

    If possible, I would like it to move towards the position of the mouse, and then letting to of the object doesn't throw it, but rather, releases hold of it. I tried this with phys force but it's way too wobbly.

  • on event object 1 collides with object 2

    action destroy object 1

    action create object 1 on the layer at x = random(Range), y = random(Range)

    for Range, type in the minimum and maximum boundaries you want the object to spawn inside.

  • I thought the "wait" action was a bad idea to use, and I kept hearing that DT was better than some other form of timing. >_>

  • If I want to replace my "wait 1 second" action an equivalent that uses delta time, how exactly would I go about that?

  • Thanks a lot sir. =)

  • > Thanks for the capx but that's not quite what I had in mind. Basically I want to be able to hold the object with the mouse before throwing it. I looked into easetween and i don't really know if it's what I'm looking for. I can't get it to work correctly. It seems to be for animation rather than physics.

    Solution (1 event)

    On drop - Apply impulse 6 toward (MouseX, MouseY) at image point 0

    (Crate uses drag and drop behaviour)

    Edit...The event above doesnt not work !

    This is my latest attempt-

    https://dl.dropbox.com/u/22173473/ThrowPhysics2.capx

    <img src="smileys/smiley9.gif" border="0" align="middle" />

    Oh..That actually works great.

    One problem though. I'm trying to get it to work with right clicking instead of left clicking which drag and drop stupidly doesn't seem to support. How can I do this without drag and drop?

  • Thanks for the capx but that's not quite what I had in mind. Basically I want to be able to hold the object with the mouse before throwing it. I looked into easetween and i don't really know if it's what I'm looking for. I can't get it to work correctly. It seems to be for animation rather than physics.

  • Hi friends.

    I'm making a game where I want to be able to drag and drop an object, but with having it so that if you let go of an object it motion, it will continue to be in motion (like throwing something with your mouse)

    The problems I've encountered with drag and drop and set position is that they immediately halt movement after you let go. Alternatives with "apply force towards position" are way too random and you lose a lot of control over the object.

    Can anyone help me out with a solution?

  • If I wanted to drag a phys pistol anywhere on the screen, making it accelerate towards and aim towards the mouse pointer, stopping acceleration when it reaches the pointer so you have an accurate shot, how would I go about stopping it's movement?

    The problem I'm having with this is that I can drag, drop and move the gun just fine, but once it gets to the mouse it starts doing loopies around the mouse position, or if I make it so it can't do that, it just starts falling downwards because of the phys gravity, still aiming towards the mouse pointer. There doesn't seem to be a way to disable or enable physics/set the gravity of a single object, otherwise this would be a lot easier for me.

    Anyone have any suggestions?

  • Thank you, but it doesn't seem like this formula compares the direction of the forces, in which case, if two asteroids are moving very fast together in a similar direction they touch slightly, they take the same amount of damage as if they rammed head on.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • so would it be something like this?

    abs((total player velocity) - (total object velocity)*mass) = damage

  • So what you want to do is pick a random object that has a value of 0? I don't think you want a loop for that.

    You might want to do something like this:

    Event: Object.Value = 0

    Sub Event: Pick a random object

    SubSub Event: Do your stuff.

    I'm not 100% on that though.