Stop Path Following

Any Good News about the code? Btw I still have no Idea on how to refill :thinking: :sweat_smile:

I will make Mira HQ
I think ur replies are refilled
I play among us

1 Like

Do you still need help with this?
I am trying to understand what the issue is. Are you having an issue with this code?

let Path_Green = scene.aStar(tiles.getTileLocation(87, 59), tiles.getTileLocation(55, 67))
scene.followPath(Green, Path_Green, 30)

Yes I still need help! So you might know Among Us… A murder mystery game… anyways Green goes to a point of the map by using the path following extension… when I am the murderer and kill him while he is walking his dead body will just slide along… I want it to stay there where I killed Green! Any ideas to make him stop?
Thanks
(This is my second account because I dont know how to refill my replys)

I don’t know what to do. sry. I looked at all the blocks and can’t find out how to stop the sprite. I think I have one idea tho. You can make velocities onto the sprite instead of making a path for it and then if hes dead, you can stop its velocity instead of making a path sprite

Thanks for your ideas and your help! I might also have an idea but I would need your help. To delete the old sprite and create a new sprite there where the guy was killed. I tried it before but since a sprites position is not a vaid number or position… Like:
Create Sprite (image) of kind (corpse)
set (corpse) to position (green)
But it did not work… I would appreciate it if you could help me there (if you have an idea on how to set a sprite on top of another sprite)! Thank you for the help and everything!
Maybe another member has an idea? Without the path following the people just stand there and its boring… I could do something like in the Sneaking around School Game but then the floor would look bad and the code is giant…

I just set the sprite to follow to the tile it’s on at speed 0. Works for me.

Sorry for the horrible images, I’m on a phone right now and my phone too small. :confused:

The green location of sprite blocks are from the tilemap extension.

So the code would be something like:

sprite follow path from tile sprite on to tile sprite on at speed 0

Thanks a lot I will try it now!

1 Like

I cant find the
(sprite) data (text) as sprite
where is it?

1 Like

Oh, sorry, forgot to say, that you should replace the sprite data text as sprite with your sprite that you want to stop the path following.

That was from a project I’m currently working on.

Well thanks but it does not work… either I delete him on overlap (so I removed it)
Now if I kill him he will not follow his path… but he slides along until he hits a wall
Thanks anyways
Ok well he actally runs into a wall… even if he is alive…

1 Like

I think @UnsignedArduino used the sprite data extension. I don’t recall seeing any blocks relating to the sprite data extension. When you click the button where you can add extensions, just search for sprite data

I already have that extension and he said I dont need it thanks though

1 Like

oh ok. I have bad memory sometimes. I always forget to do them.

1 Like

I do rubiks cubes all the time and its hard for me to keep track of all the algorithms

1 Like

I think you are setting a sprite to follow a path of tiles. In that case, it could be that once you have set the action, removing the action may not be possible. I’ve noticed for certain functions that once you set things it is not always possible to remove it. If that is the case, it might be better to destroy the sprite and recreate it.

2 Likes

Well, I was using it, but just replace it with the sprite you want to stop path following.

I know but how do I put a sprite ontop of another sprite?

Hey, worth a note I responded to your github issue on this :slight_smile: https://github.com/microsoft/pxt/issues/7531#issuecomment-711099287. The issue was that the extension was stopping the path following, but not the sprites current velocity when the path follow rate was set to 0 - so it wasn’t following the path anymore, but just going innwhatever direction it was moving last. Easy fix though - after setting it to follow at rate 0 for the destroyed crewmate, you can call set sprite velocity to 0vx 0vy to clear it out yourself, or you can go in and update the version of the extension to one that fixes it (note that this will move your blocks around, though - I’d use a share link to make a backup just in case it gets rearranged in a eay you dont like)

2 Likes

Thank you very much! This will make everything easier! I already tried it and it works! I can finally take the game to the next step! And also thanks for the hitbox/distance between players extension! I was close to giving this project up, fortunately I did not! I will keep on coding! I started a few years ago in school with micro:bit. Then I realised what I can do with it! I coded a program with 5 Games and 3 apps you could choose from, but after that I had no ideas… So I searched for some ideas and found makecode Arcade! I am new to the arcade programming: Because I coded games on the micro.bit I knew about sprites and so on…
At first I made a plane game… and later I was bored so I played Among Us and… yea… :bulb:
I watched the makecode tower defense and found out there was a following extension…
And btw sorry if my English is bad… I am from austria and young…
Thanks!!! I can now start coding and maybe… there will be a game jam… soooo… Also I’ll probably get a meowbit for christmas…
Thanks for your help!
Regards
Dahbix

Btw this is my second acoount because I only signed up yesterday and then my replys ran out and I have no idea on how to refill

1 Like