Discuss Scratch

b1048546
Scratcher
1000+ posts

How do I make an enemy platformer?

I need help making a enemy platformer with levels, enemies, coins, flags and more! I'm pretty sure that I already know how to make platforming scripts and wall collision. The first thing I need help is how do I make enemies?
1ScrachMaster
Scratcher
19 posts

How do I make an enemy platformer?

Do you know how to make a AI?
semmiesem9
Scratcher
100+ posts

How do I make an enemy platformer?

I'm not sure what kind of enemy you want, but if you want your enemy to be affected by gravity like the player then it will need the same platforming scripts as the player. Rather than using “go to” blocks, you would need to tell the enemy which “buttons” to press, as if the enemy is a player itself.
b1048546
Scratcher
1000+ posts

How do I make an enemy platformer?

1ScrachMaster wrote:

Do you know how to make a AI?
No. I have been trying to learn but no.

semmiesem9 wrote:

I'm not sure what kind of enemy you want, but if you want your enemy to be affected by gravity like the player then it will need the same platforming scripts as the player. Rather than using “go to” blocks, you would need to tell the enemy which “buttons” to press, as if the enemy is a player itself.
Well, I can draw anything so let's just say that the enemy is one that moves slowly and f you touch it you die and if you jump on it it dies.
light_cloud
Scratcher
1000+ posts

How do I make an enemy platformer?

b1048546 wrote:

1ScrachMaster wrote:

Do you know how to make a AI?
No. I have been trying to learn but no.

semmiesem9 wrote:

I'm not sure what kind of enemy you want, but if you want your enemy to be affected by gravity like the player then it will need the same platforming scripts as the player. Rather than using “go to” blocks, you would need to tell the enemy which “buttons” to press, as if the enemy is a player itself.
Well, I can draw anything so let's just say that the enemy is one that moves slowly and f you touch it you die and if you jump on it it dies.
okay so in the enemy sprite have something like this
iftouchingplayer?thenifcolorcolor enemy of headistouchingcolor of player feat?thendie
BitTheDrone
Scratcher
100+ posts

How do I make an enemy platformer?

Try to make a simple AI, make if move back and forth, or always moving toward you.

If you want to make your character step on it, use the

iftouchingcolor?then

or make the top of its head a different sprite.
Here's a good jumping script:

whenclickedset(gravity)to0foreverifkeyup arrowpressed?andtouchingground?thenset(gravity)to3changeybygravityrepeatuntiltouchingground?changegravityby-0.1changeybygravity

Good Luck!

Last edited by BitTheDrone (Nov. 26, 2019 16:25:37)

BitTheDrone
Scratcher
100+ posts

How do I make an enemy platformer?


Try to make a simple AI, make if move back and forth, or always moving toward you.

If you want to make your character step on it, use the

iftouchingcolor?then

or make the top of its head a different sprite.
Here's a good jumping script:

whenclickedset(gravity)to0foreverifkeyup arrowpressed?andtouchingground?thenset(gravity)to3changeybygravityrepeatuntiltouchingground?changegravityby-0.1changeybygravity

Good Luck!

Last edited by BitTheDrone (Nov. 26, 2019 16:27:28)

light_cloud
Scratcher
1000+ posts

How do I make an enemy platformer?

BitTheDrone wrote:

Try to make a simple AI, make if move back and forth, or always moving toward you.

If you want to make your character step on it, use the

iftouchingcolor?then

or make the top of its head a different sprite.
Here's a good jumping script:

whenclickedset(gravity)to0foreverifkeyup arrowpressed?andtouchingground?thenset(gravity)to3changeybygravityrepeatuntiltouchingground?changegravityby-0.1changeybygravity

Good Luck!
you problem didn't mean to post this.
b1048546
Scratcher
1000+ posts

How do I make an enemy platformer?

light_cloud wrote:

b1048546 wrote:

1ScrachMaster wrote:

Do you know how to make a AI?
No. I have been trying to learn but no.

semmiesem9 wrote:

I'm not sure what kind of enemy you want, but if you want your enemy to be affected by gravity like the player then it will need the same platforming scripts as the player. Rather than using “go to” blocks, you would need to tell the enemy which “buttons” to press, as if the enemy is a player itself.
Well, I can draw anything so let's just say that the enemy is one that moves slowly and f you touch it you die and if you jump on it it dies.
okay so in the enemy sprite have something like this
iftouchingplayer?thenifcolorcolor enemy of headistouchingcolor of player feat?thendie

BitTheDrone wrote:

Try to make a simple AI, make if move back and forth, or always moving toward you.

If you want to make your character step on it, use the

iftouchingcolor?then

or make the top of its head a different sprite.
Here's a good jumping script:

whenclickedset(gravity)to0foreverifkeyup arrowpressed?andtouchingground?thenset(gravity)to3changeybygravityrepeatuntiltouchingground?changegravityby-0.1changeybygravity

Good Luck!
Sorry for letting you know this late but I need help for the platforming script too. If you can help me we can worry about that part first.
1ScrachMaster
Scratcher
19 posts

How do I make an enemy platformer?

The way I make a AI is this. I take the platformer script you used for the player, and then instead of using
keyup arrowpressed?

use

y positionofplayer<yposition

and instead of using

keyleft arrowpressed?

use

x positionofplayer<xposition
1ScrachMaster
Scratcher
19 posts

How do I make an enemy platformer?

Oh, the platformer script? There are tons of youtube videos on that! Just type into youtube: how to make a platformer in scratch
——————————————————————————–
17% of 100 posts

Last edited by 1ScrachMaster (Nov. 26, 2019 18:11:43)

Disi0007
Scratcher
5 posts

How do I make an enemy platformer?

this is old
b1048546
Scratcher
1000+ posts

How do I make an enemy platformer?

Disi0007 wrote:

this is old
And really resolved. I can go much further than the boundaries of this now. I should close this.

Powered by DjangoBB