Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help with an enemy
- 20140069G
- Scratcher
22 posts
I need help with an enemy
So I am making a game which has bullets travelling at very high velocities, therefore it doesn't register as it touched another sprite, if i don't want to lower the speed, what should i do?
Here's the code I'm using for the receiver:
https://imagetolink.com/ib/cTWWXnXMNv
Here's the code I'm using for the projectile:
https://imagetolink.com/ib/2IXbjCVfdL
Thanks for anyone helping me!
P.S: Yes, I posted this twice because i got the wrong topic and I don't really feel like deleting the other one.
Here's the code I'm using for the receiver:
https://imagetolink.com/ib/cTWWXnXMNv
Here's the code I'm using for the projectile:
https://imagetolink.com/ib/2IXbjCVfdL
Thanks for anyone helping me!
P.S: Yes, I posted this twice because i got the wrong topic and I don't really feel like deleting the other one.
- deck26
- Scratcher
1000+ posts
I need help with an enemy
Better to share the project than script images.
Generally you don't want to be using glide blocks if the same script is supposed to detect touching something - while the glide block is running the rest of the script is ignored.
Generally you don't want to be using glide blocks if the same script is supposed to detect touching something - while the glide block is running the rest of the script is ignored.
- ramenecho
- Scratcher
100+ posts
I need help with an enemy
Ok, by the looks of it you have the bullets and enemy’s doing there things when the backdrop is 2, so this solution is assuming that is the case, So I am making a game which has bullets travelling at very high velocities, therefore it doesn't register as it touched another sprite, if i don't want to lower the speed, what should i do?
Here's the code I'm using for the receiver:
https://imagetolink.com/ib/cTWWXnXMNv
Here's the code I'm using for the projectile:
https://imagetolink.com/ib/2IXbjCVfdL
Thanks for anyone helping me!
P.S: Yes, I posted this twice because i got the wrong topic and I don't really feel like deleting the other one.
The glide block you have running is the main cause of your issues, its basically the equivalent of having it wait 8 seconds, so once it starts that glide to block, it will not continue with the code until it has finished gliding
Heres a solution id recommend if you are ok with this “enemy” pointing towards “Tom”:
foreverThis script above is also optimized to reduce the amount of un-needed scripts running at once, you can separate them again if i misunderstood the situation they are being used in, its just running a lot of (if) blocks per second causes a slight amount of lag
if <(backdrop #) = [2]> then
point towards [Tom v]
move (Insert the speed you want here) steps
if <touching [bullets v] ?> then
next costume
if <(costume #) = [3]> then
hide
end
end
end
end
If you do not want the enemy to point to “Tom” then you can do:
foreverThis just does the same thing but points away again after its done, you might want to put the entire thing into a custom block with screen refresh disabled, the sprite might be flashing if not
if <(backdrop #) = [2]> then
set [Prev Direction v] to (direction)
point towards [Tom v]
move (Insert the speed you want here) steps
point in direction (Prev Direction)
if <touching [bullets v] ?> then
next costume
if <(costume #) = [3]> then
hide
end
end
end
end
I hope this helps! Please tell me if it doesn’t.
Last edited by ramenecho (March 26, 2024 12:52:37)
Hello there, this is a cool signature! You can even make your own wow! I really need somebody to check my game for bugs, MineQuest Idle its not the highest quality of games, but its an improvement from my previous ones
- 20140069G
- Scratcher
22 posts
I need help with an enemy
Just a question about the first option, are you reffering to the receiver or to the bullet it self?
- ramenecho
- Scratcher
100+ posts
I need help with an enemy
This is for the receiver. Though i forgot to mention that in the bullets code you might want to also replace that glide to block with a step block Just a question about the first option, are you reffering to the receiver or to the bullet it self?
Hello there, this is a cool signature! You can even make your own wow! I really need somebody to check my game for bugs, MineQuest Idle its not the highest quality of games, but its an improvement from my previous ones
- 20140069G
- Scratcher
22 posts
I need help with an enemy
Thanks alot! I will make sure to play you're game! Thanks again!
- ramenecho
- Scratcher
100+ posts
I need help with an enemy
Happy to help, also sorry for making such a long response to a simple solution, that’s something i really need to work on. Also thanks for trying out my game! Good luck with yours too. Thanks alot! I will make sure to play you're game! Thanks again!
Hello there, this is a cool signature! You can even make your own wow! I really need somebody to check my game for bugs, MineQuest Idle its not the highest quality of games, but its an improvement from my previous ones
- 20140069G
- Scratcher
22 posts
I need help with an enemy
I am checking you're game out, and it's very complicated! Although im really interested and it does look like a hidden gem of a game i come here with a suggestion:
Make the game show the most complex features later into the game!
Yes, only show the essential in the beginning and go explaining it along as the player progresses so it makes the learning of the games mechanics easier!
Of course this is only a suggestion and if you want you could keep the game like this, incase you dont know how to implement this i can give you an example:
The overkill feature, you could only show it when the player gets an overkill! Instead of showing it way before the player is able to do it.
Again, thank you and for the other people helping me and have a good development of your game!
Make the game show the most complex features later into the game!
Yes, only show the essential in the beginning and go explaining it along as the player progresses so it makes the learning of the games mechanics easier!
Of course this is only a suggestion and if you want you could keep the game like this, incase you dont know how to implement this i can give you an example:
The overkill feature, you could only show it when the player gets an overkill! Instead of showing it way before the player is able to do it.
Again, thank you and for the other people helping me and have a good development of your game!
- 2006kush2010
- Scratcher
32 posts
I need help with an enemy
define Move (steps) steps detecting <condition>And,
set [condition v] to [0]
repeat (steps)
move (1) steps
if <condition> then
set [condition v] to [1]
stop [this script, if you prefer v]
end
end
end
To move the bullet a certain number of steps,
move (the number you want here) steps detecting <touching [enemy v] ?>
...
if <(condition) = [1]> then
delete this clone
end
This should work
Interesting Projects you might want to check out
Shepard Tone:
https://scratch.mit.edu/projects/639784420/
Mind Reader:
https://scratch.mit.edu/projects/672279652/
Satisfying colour brush:
https://scratch.mit.edu/projects/790960999/
- 20140069G
- Scratcher
22 posts
I need help with an enemy
P.S: In the tutorial where its showing the gems theres an overlap in the text, i think it has to do with the fuse gem sprite, here's the image:
https://imagetolink.com/ib/4aKarePSWN
Edit: This is a very minor bug tho, don't make it a top of you're priorities.
https://imagetolink.com/ib/4aKarePSWN
Edit: This is a very minor bug tho, don't make it a top of you're priorities.
Last edited by 20140069G (March 26, 2024 13:08:26)
- ramenecho
- Scratcher
100+ posts
I need help with an enemy
Just so you know, every time you add a reply to this post, it goes to the top of the forum again, so if your gonna mention anything, please do it in the games comments, thanks! Also that is a known bug. P.S: In the tutorial where its showing the gems theres an overlap in the text, i think it has to do with the fuse gem sprite, here's the image:
https://imagetolink.com/ib/4aKarePSWN
Edit: This is a very minor bug tho, don't make it a top of you're priorities.
Hello there, this is a cool signature! You can even make your own wow! I really need somebody to check my game for bugs, MineQuest Idle its not the highest quality of games, but its an improvement from my previous ones
- 20140069G
- Scratcher
22 posts
I need help with an enemy
2 suggestions:
-1: Make the game auto clicker proof, i tested it with and it worked doing insane dmg to blocks.
-2: Make it so that when you try to buy an upgrade but you have no money it displays a message saying that you don't have enough money.
-1: Make the game auto clicker proof, i tested it with and it worked doing insane dmg to blocks.
-2: Make it so that when you try to buy an upgrade but you have no money it displays a message saying that you don't have enough money.
- 20140069G
- Scratcher
22 posts
I need help with an enemy
Yet another suggestion:
I don't really know how to do it, but since you seem like an experienced scripter, i suggest you making the game save to cloud, therefore saving progress.
I don't really know how to do it, but since you seem like an experienced scripter, i suggest you making the game save to cloud, therefore saving progress.
- 20140069G
- Scratcher
22 posts
I need help with an enemy
A bug:
When you collapse the gems tab in the 2nd menu the numbers of the gems still remain, even tho the tab is not open, here are 2 images:
https://imagetolink.com/ib/5rPRL5NQI1
https://imagetolink.com/ib/59iFtonoJe
When you collapse the gems tab in the 2nd menu the numbers of the gems still remain, even tho the tab is not open, here are 2 images:
https://imagetolink.com/ib/5rPRL5NQI1
https://imagetolink.com/ib/59iFtonoJe
- 20140069G
- Scratcher
22 posts
I need help with an enemy
Also is this intentional or is this a bug?
I can't seem to go back to earlier blocks, for example im at rubber block now and im not able to go back to dirt.
Edit: I didn't realize you swiped with your mouse down, i thought you only could use the arrow, therefore i think you should add an arrow to the left.
I can't seem to go back to earlier blocks, for example im at rubber block now and im not able to go back to dirt.
Edit: I didn't realize you swiped with your mouse down, i thought you only could use the arrow, therefore i think you should add an arrow to the left.
Last edited by 20140069G (March 26, 2024 13:39:35)
- ramenecho
- Scratcher
100+ posts
I need help with an enemy
Once again, every message here puts the forum post at the top, pleas just use the comments on the game or comments on my profile page Also is this intentional or is this a bug?
I can't seem to go back to earlier blocks, for example im at rubber block now and im not able to go back to dirt.
Edit: I didn't realize you swiped with your mouse down, i thought you only could use the arrow, therefore i think you should add an arrow to the left.
Hello there, this is a cool signature! You can even make your own wow! I really need somebody to check my game for bugs, MineQuest Idle its not the highest quality of games, but its an improvement from my previous ones
- Discussion Forums
- » Help with Scripts
- » I need help with an enemy