Sprazzal's Forum Posts

  • So, I'm making a platformer where the character can shoot out this projectile which moves at a set speed, and after getting a certain distance away from the character returns to the character, and if it hits a wall before reaching said distance it will trigger an event.

    I don't have any problems there, but I want to add an adaptive tiled line which, while the projectile is in the air, will have one end attached to the projectile, and the other end following the player around, so it will have to change size and angle depending on how far away and in what direction it is from the player.

    Basically, I want Terraria's grappling hook, if you happen to know how that works.

    In the likely case my current explanation makes zero sense, I put an image below. Imagine the line is tiled, and each tile is represented by a number in that image. When I press space, it shoots out the blue thing towards the cursor, and the 1 follows behind, then 2, 3, etc. The highest number that is out is next to the player, and all numbers form a line between the player and the blue thing. Once 10 tiles are out, the blue thing starts going back towards the player, and the numbers go back in.

    So if you've understood what I'm on about and have an idea as to how to program this line, that would be very helpful. Thanks in advance!

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • Since I'm using the platforming behaviour I had to make it so that it didn't apply for walls and make it on collision, but this did work, so thanks!

    Only problem is I'm also trying to use a wall climb mechanic where you can climb for a bit then you run out of 'stamina', like Shovel Knight Spectre of Torment if you've played that. So would it be possible to have my character overlapping with the wall but still make them stop climbing when they hit the ceiling?

  • So I've made a code with variable jump height using a couple of variables, and I've come across an issue which I feel like there should be an easy answer for - when I hit a ceiling my character keeps trying to move upwards, but it can't because there's a solid block in the way, and it ends up just hovering there before it starts falling naturally. So is there a way of starting a command with when the sprite hits a ceiling or the likes, so that I can set platform vector Y from there and make it start falling prematurely? Thanks in advance!

  • Well, that was kind of the trouble to begin with. I originally had it how you suggested, so having it directly set the bullet angle of motion to the angle between the Sprite and the mouse cursor, but it didn't end up changing the angle of motion at all - or more specifically it would set it to either 180 or 0 depending on which it was closer to. So I did the thing with the instance variable to stop this from happening. I also ran an experiment where I had it wait a set time before starting the movement (so after it had done all the bullet angle setting and that) and it still had the problem, so I don't think it's that.

    Thanks for the reply though, sorry it didn't help.

  • Ok so I'm a beginner and I've started making a game where the character is able to dash towards the cursor, but I'm having this issue where the character moves right or left (depending on which side of the character my cursor is) at the start of the dash, then starts moving in the direction it's supposed to (I'm using the bullet behaviour) The amount that it moves right/left scales with the speed I've set it to (higher speed means it moves further before going where I want it to) so I'm assuming the problem is that it starts moving before setting the angle of motion but I haven't set it that way in the code and I don't know anything about this.

    My code is as follows:

    or in case the link doesn't work:

    imgur.com/6kvxmSl

    Does anyone have any ideas of what might be the problem and/or how to fix it? Thanks in advance!