terence's Recent Forum Activity

  • That works, thanks.

    One problem is that I want to restrict the 8direction movement to 4 directions. Works fine with the keyboard, but on the gamepad the left stick only allows up and down movement. Right and left movement are not detected when movement is restricted to 4 directions (via behavior properties). Have tried setting the default control flag to "No" and used different controllers so think it may be a Construct bug.

  • That works but there are two issues. When the player moves (with the left stick) the target get left behind until the right stick is moved. I'd like the target to stay on the circumference of a circle which is at a 300 pixels radius from the Player's origin. This is why I was trying to use the Pin behavior in bar mode.

    I'd also like the target to stay at the point on the circumference where it was left by the player on releasing the right stick. So that if only the left stick is being moved, the player can strafe/move in straight lines, rather than circle around the target which is what currently happens in your capx.

    Not sure if this can be achieved without the Pin behavior.

  • I'd like to recreate functionality in the attached capx where instead of the mouse cursor, the gamepad right stick controls the player target in my top down game. The target needs to be set a fixed radius from the player (using pin behavior in bar mode).

    Have looked through a number of gamepad examples but can't find the equivalent gamepad action for "Set Position to (Mouse.X, Mouse Y)"

  • In the event below I'm finding that the Wait time is not being triggered based on instance variable. If I remove the Else conditions then it works fine. What's the correct way to use Wait with an If-Else block?

    On Key R pressed:

    Player - Weapon = "gun"

    set Reload gun animation

    > wait 2 seconds

    set ammo to 5

    set Idle animation

    Else

    Player - Weapon = "uzi"

    set Reload uzi animation

    wait 3 seconds

    set ammo to 10

    set Idle animation

    Else

    Player - Weapon = "AK47"

    set Reload AK47 animation

    wait 4 seconds

    set ammo to 15

    set Idle animation

  • sgtwombatstudios: your logic makes sense but am having trouble getting it working. See CAPX: sendspace.com/file/0ayn32

    RamPackWobble: your method gives a realistic arc, but I'd like to avoid creating separate sprites for the bounced grenade. Also I'd like to be able to modify the number of bounces without having extra code for each bounce, maybe using a function?

    Paradox, an example capx would be helpful to better understand what you're suggesting.

    ArcadEd: Which version of EaseTween are you using? Couldn't get your file open.

  • Yes, have set them to global variables. The target reticule still moves back towards the center the moment the right stick is released, as I guess the global variables are set to 0 as soon as this happens?

    When I try to set the player angle toward (Target.TargetX, Target.TargetY) after setting TargetX to OffsetX and TargetY to OffsetY every tick, the player doesn't rotate towards the reticule. The only way I can get this to work is if I use Set Angle To: angle(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3)) but this snaps the player angle back to 0 on releasing the right stick.

    Not using ScrollX/Y as UI is on a separate layer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • keepee, thanks that addresses points 1 and 3. Any suggestions on point 2? I can't think of any way to get the target to stay in position (and therefore the player angle) when the right stick is released.

  • LittleStain, that's my goal. The mouse.x/mouse/y movement is what I'm trying to replicate.

    keepee, dividing by 100 works in cases where my layout matches the window size, but I'm facing a few issues:

    1. If my layout is much larger than the window size, the target stays within the top left of the layout and doesn't follow the player.

    2. When the right stick is not being used the target defaults to a position just off center of the window and the player sprite snaps back to a 0 angle. I'd like the target to stay where the it was last left (just like a mouse cursor) and have the player stay pointing towards that angle.

    3. The player angle isn't exactly aligned with the target. To set the target angle I'm using Set Angle To: angle(0,0,Gamepad.Axis(0,2),Gamepad.Axis(0,3))

    Any suggestions on how to address these issues?

  • That makes sense but doesn't seem to work as it should, using Window Width/Height, global variables or hardcoded values. I seem to get huge X and Y values when the right stick is moved, so the cursor immediately goes off screen.

    Updated CAPX: sendspace.com/file/uljgcd

  • For my top down game (twin stick shooter with left stick movement, right stick aiming) I'm trying to replace the mouse with the right thumbstick but can't replicate the following:

    On Event -->

    Player: Set angle toward (Mouse.X(0), Mouse.Y(0))

    On Start Layout -->

    Mouse: Set cursor from sprite <Target reticule>

    So the left stick controls the usual WASD movement, and the right stick needs to move the cursor around the screen so that the player angle follows the cursor (rather than rotate the player directly). So I need a way of mapping the gamepad axis to an X,Y position for the cursor.

    Linked CAPX is based on the example in this thread:

    scirra.com/forum/360-aiming-with-a-gamepad-using-the-right-stick_topic73154.html

    CAPX: sendspace.com/file/52lruh

    Any suggestions appreciated.

  • Concept wise it's similar to what I'm going for but your arc is from a first person perspective (large to small) whereas I'm looking for a straight top down arc (small - large - small). I'd be interested to know how you scale the balloons after throwing.

    The other things I'm trying to do for regular grenades that I guess don't apply to water balloons are multiple bounces and rotation.

  • In my top down game, I'm trying to create a realistic grenade which when thrown by the player does the following:

    1) Gives the appearance of an arc by increasing the size/scale of the grenade sprite then decrease back to normal size to give the appearance of height (rather than using shadows)

    2) Allow player to charge the grenade by holding down the mouse button, the greater the charge, the further the distance thrown and the greater the "fake" height

    3) Bounce off any solids (regardless of the fake height)

    4) Rotate the grenade sprite a random number of degrees while it is in the air on its origin imagepoint.

    5) Bounce the grenade off the "floor" 3 times before coming to a stop (i.e. increase and decrease scale 3 times, in smaller increments each time).

    6) Have grenade explode several seconds after being thrown and generate a short lived blast radius

    In the capx below I have items 2, 3 and 6 implemented but not sure how to go about items 1, 4 and 5.

    Any suggestions appreciated.

    CAPX: sendspace.com/file/pzx3q5

terence's avatar

terence

Member since 7 Sep, 2013

None one is following terence yet!

Trophy Case

  • 11-Year Club
  • Email Verified

Progress

12/44
How to earn trophies