Jasper's Recent Forum Activity

  • My dream game would be a huge open world race game where you can play online matches against players all over the world, create your own race tracks and unlock the fastest cars!

  • Have you tried increasing your gravity?

    edit; Yoshi doesn't really use physics (at least, not realistic physics like construct 2 provides). That's why Yoshi follows the curves neatly, and your snowboarder flies away if he's too fast. Increasing your gravity might work, but note that your snowboarder might still be too fast.

  • Create 2 instance variables called grabX and grabY

    On touch (or click):

    set grabX to sprite.X-touch.X

    set grabY to sprite.Y-touch.Y

    Every tick (if being dragged):

    Set the position to Touch.X+Sprite.grabX,Touch.Y+Sprite.grabY

    Good luck <img src="smileys/smiley2.gif" border="0" align="middle">

    PS: see my earlier created example here.

  • Here you go.

    dl.dropbox.com/u/87237423/D%26D.capx

    Notes:

    dragX is the X position on the sprite of where the mouse took hold of the sprite. (can you figure out what dragY is? <img src="smileys/smiley1.gif" border="0" align="middle" /> )

    As soon as the mouse clicks on the object you want to drag & drop the local boolean PickedUp is set to true, as soon as the mouse releases the button Picked Up is set to false.

    First we test whether the mouse is within the area of where drag and drop-ing is allowed. If it is > we set the sprite to the Mouse.X en Mouse.Y.

    If its not, we test whether the mouse is too far to the right or whether it is too far down. In the first case we set the sprites x to the furthest allowed x and set the y to Mouse.Y. Second case works like this.

    Then, at last, we test if the mouse is both too far to left and and too far downwards, and we set the position of the sprite to the furthest allowed position.

    If you got any questions just let me know ;)

    PS: I too late realised I could use imagepoints (I used to make games with Gamemaker which has not imagepoints ;d), so these might be handier instead of using Sprite.height/2 etc (also only works when the origin is in the middle of the image!)

  • Replace the drag and drop behaviour by your own events.

    I'm creating an example for you right now so I don't have to explain it, hold on a minute

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This should work:

    <img src="http://img59.imageshack.us/img59/9155/naamlooskco.png" border="0" />

  • Great game! I would however try setting a maximum speed for the bal, sometimes it gets a little to fast IMO.

  • You can test whether a finger touches on an object using the Touch -> On Touched Object event. Select the object you want to rotate, and in the events you add the Rotate clockwise (or counter-clockwise) action for the object.

    If you want to test for the mouse however you should add the Mouse button is down condition, right click it and select add another condition. This time choose Cursor is over object. Then you can add the events to rotate the object.

    Note; You can't simply use the 'mouse on object clicked' event because this way you'd have to click it multiple times to rotate it (and not instead holding the mouse button down).

    If you want to allow the object to be only rotated to 45, 90, 135, 180, etc, you should be a little more specific. Do you want to make the object rotate immidiately 45 degrees after a second passes (and not smooth)? Or do you want it to rotate a little (eg 5 degrees) as long as the object is touched? In the last case, should it rotate to the nearest interval(-thing? 45 or 90 or 135 or etc)? Or should it always rotate upwards (so if the angle is say 60 and the object isn't touched anymore it automaticly rotates futher to 90).

  • Nice graphics!

  • Can't you just give the bullet the speed & direction the player has at the moment of shooting and then adding the bullet's own speed & direction? So if you'd shoot the same direction as you were walking the bullet's speed would be the players speed + its own speed. It should be possible to calculate the bullet's speed & angle when the player shoots in a complete different direction using sin, cos and/or tan. I can help you with that if you'd like (if you didn't try this method before and you don't know whether it works, I'm not completely sure either ;) ).

    If that doesn't work out you could also consider making bullets which hit at the moment of shooting, so fast it can not be seen. You could use a thin rectangle for the bullet sprite, which will test for collisions with other objects as soon as is created (and after that it is immidiately destroyed).

    Edit: I created an example of my first mentioned solution:

    Download

    Note; Because I made the bullets so slow it might look a little weird, but this way the effect is seen best. If you have a question about it let me know ;)

  • dat graphics

  • This looks pretty cool, but do you think it's possible to fill the polygon with a sprite which would then get 'stretched' up nicely? <img src="smileys/smiley1.gif" border="0" align="middle" />

Jasper's avatar

Jasper

Member since 11 Jan, 2012

None one is following Jasper yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies