InfiniteRockets's Forum Posts

  • I've implemented my own version adapted from the mouse control, but I'm running into some strange behaviour which might be related to gamepad controls and lack of a mouse cursor to reorient the radial position to. The radial motion is funtionally working, but I'm not exactly sure what is causing the issue (it's possible the analogue position resetting to 0 if the player shoots and lets off the stick?).

    I've attached the project file if anyone with a gamepad could have a look - you should be able to see what the problem is compared to the effect that I'm trying to create in the first animated gif. Essentially, the example that dop2000 provided is exactly what I'm going for, but mapped to gamepad.

    https://www.dropbox.com/s/4rqw7ulf78hle2g/RecoilGamepad.c3p?dl=0

    This is a quick gif of the issue that might be helpful too: -

    Thank you for any help you can give!

  • Amazing, thank you so much, and also for the original tutorial; it's a great method!

  • The gun can rotate to any angle - it’s pretty much the same as your example, but mapped to an analogue stick, so it would recoil based on its relative position. Here’s another quick gif showing the current implementation: -

  • I've implemented a radial aiming system for the platform behaviour with some weapon recoil using the method outlined in dop2000's excellent tutorial (thank you!). I've adapted this to a gamepad, and it's working well using the following events: -

    However, I'd like to add some radial recoil to complement this, and I think I can use the same method, but I'm struggling with how to adapt the expressions to fit this radial movement instead of the single opposite angle that the gun is firing. Could anyone suggest how I might do this?

    The end result would be something like this (i've roughly simulated the movement manually to show this - the quality of the gif makes it a little hard to see, but the gun kicks both backwards and radially around the aiming arc of the player, and then resets to default position): -

  • Just an update for anyone reading this thread in the future; I managed to get all of this working by changing the way that the weapon is attached to the player in the first place, and it was really simple.

    First, I changed the Origin of the turret to 64 pixels behind it, and pin this to the centre of the player at the start of the layout. Next, I used a condition to check that if the axis of the right analogue stick is anything other than 0, put it into a global variable and then set the angle of the turret to this. This is essentially how the demo twin-stick shooter handles it.

    Simple yet functional!

  • Brilliant, thanks for your help; do you happen to have a screengrab of the events or an example capx to hand?

  • I'm trying to implement a simple radial aiming mechanic using gamepad controls. So far, I have this working, where the position of the aiming sprite is set to the player's centre, as if the character was holding/aiming the weapon by their side. However, my intention is to have the aiming sprite offset so that can orbit the player by a set distance (i.e. like a 360 degree floating turret).

    I thought I could achieve this by messing around with ImagePoints, but this doesn't seem to work as intended (the angle of the sprite does not line up with the position of the analogue stick). Can anyone suggest a particular approach here? I feel like it should be relatively simple, but I'm missing something obvious.

    A secondary issue I have is that the aim angle springs back to the original position, understandably, as the analogue stick is disengaged. How would I be able to leave the position of the aiming sprite in the last position that the player aimed in? Would I need to report the last set position to a variable and then set the angle to that when the stick isn't in use, or again, is there a simpler method that I'm missing?

    Thanks for any help you can provide!

  • I think the technical solution with sprites is straightforward (I have a working version with them) and I'd prefer to work with them. My main concern is that having sprites of 'complete' platforms will be an optimisation nightmare later on (i.e. some of these would be, like, 512x1024) though maybe I'm worrying too much given that these are destroyed as soon as they go off-screen.

  • Thanks - I understand that process. I'm specifically trying to make this work with hand-painted/illustrated tiles. Coming from Unity, it's a process that could be handled in an empty gameobject because you can make reference to translational values, so I'm trying to emulate something along those lines in Construct - just surprised that it seems more difficult in many respects.

  • Thanks for the input; I had a feeling that might be the case. Maybe I'm missing something, but is there a sprite/tile-based workflow in Construct that might be helpful for the kinds of platforms that I'm generating (i.e. in the gif)? I can see how placing individual tiles in a static level might work, but when I'm stitching together the world randomly from a bunch of different platform possibilities, I'm a bit lost - particularly because they can be different heights/lengths.

  • I'm creating an endless runner game with several different pre-made platforms using Tilemaps - my thinking was that being able to quickly edit each tilemap would be good for the prototyping process, as well as the eventual performance gains versus using large sprites. The Tilemap for each platform is currently a single 128x128 checkerboard image that i'm using to pain each platform, so each platform has its own instance of this image. Because I'm going to be randomly selecting these platforms, I'll be generating and destroying them at runtime without a need to have a first instance on the stage at the beginning of the game.

    What I'm struggling with is understanding how to work with the prefabs/Object types in my project and making changes to these. If I have an instance of a particular platform/tilemap on my stage and make changes to it, any further instance placed on to the stage will reflect the changes that I've made. This is totally fine and what I would expect to happen.

    However, if the final instance of the object is removed from the stage (but is still in the project), when I drag it from my project list onto the stage, it reverts to when it was first created. Except, sometimes it doesn't and it retains the changes as I would expect. Has anyone else come across this?

    Is there something about tilemaps or the Object Type/prefab workflow that I'm not understanding? Is there some way of committing changes back to the original prefab? If I was working with a Sprite, I would simply double-click on the original Object Type in the project and make changes that would be reflected in all subsequent versions of that object. But with Tilemaps, all I have access to is the original tile/sprite used to create that specific Tilemaps.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Great, thank you for your help!

  • Hi all,

    I'm making an endless runner prototype that will feature a number of preset islands/level chunks that I'm planning on spawning. I had originally planned to use large images of each island exported from Photoshop and then optimise with another soution later, but I'm keen to solve this problem now. The runner template uses the Tiled Background plugin, but my islands are going to be a little more designed than these, with different height segments etc. One of them might look something like this: -

    What is the best approach to this? So far, it seems that using a Tilemap to represent each platform would work, and I've loaded in my checkerboard template and used this as my only tile. I can then intuitively draw and test different islands. Am I likely to run into any issues with this approach? I know this isn't necessarily the intended use of the plugin.

    Something I'm not sure about is how to update each of the original island Object types/prefabs when I change some of the tiles around on the stage. If there is no existing instance on the stage, it seems to revert to the original state when I drag a new one onto thestage. With a Sprite, you can double click on the original Object and make changes that affect all other instances, but it seems Tilemaps don't behave in this way?

    Any help is appreciated, and I'm happy to provide any further information if that would be helpful.

    Thanks!

  • Thanks to both of you, I managed to get this working! Cheers!

  • I'm trying to do some basic optimisation for my endless runner where platforms are destroyed once they leave the play area. I can't use the Destroy When Outside of Layout behaviour because they spawn outside of the layout to give the impression that they're seamlessly scrolling into view. Additionally, my player is continually moving right with a simulated platform behaviour (with a camera which scrolls with it), so the world's X value is continually increasing which makes it hard to determine a specific coordinate value to destroy the platform.

    I feel like I'm missing a really simple solution here. I have been able to create an basic anchored sprite which kills the platforms off-screen when they collide with this, but I don't really like this and would rather use something position-based. Ideally, I want to do the same for any other objects/enemies that leave the screen on the left. Any help would be appreciated!