This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-01-28 18:38:48

mrbookie3
Scratcher
Registered: 2008-01-11
Posts: 8

Please help somebody!!

All I need is for some body to tell me how to make enemies in a scrolling game. I already have everything else down. Thanks.

Offline

 

#2 2008-01-28 18:49:50

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Re: Please help somebody!!

I will help you, but I need you to be a little bit more specific.


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#3 2008-01-28 19:26:25

mrbookie3
Scratcher
Registered: 2008-01-11
Posts: 8

Re: Please help somebody!!

I need to know how to make enemies in a scrolling game who appear only when the main sprite is near them  and move back and forth on a certain platform, kind of like the enemies in archknights game.

Offline

 

#4 2008-01-28 19:44:19

MITscratcher
Scratcher
Registered: 2007-09-16
Posts: 100+

Re: Please help somebody!!

I would have a variable that keeps track of how far off the enemy has gone off the screen "Supposedly" based on the distance the main player has gone, and when the enemy reaches its destinated distance, it will show, else hide. Is this enough help or use for you?


http://scratch.mit.edu/projects/MITscratcher/235497
                    ^ My NEW Snake Game! ^

Offline

 

#5 2008-01-28 20:25:49

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Please help somebody!!

Ok how I did it was fairly simple.

First create a variable for the sprite called movement.

Set this variable to how far to the right you want the sprite to be.
Try setting it to 1000 and it should appear around the third platform.

Then make a script like this.
In this example I used the variable "platforms" as the scrolling variable.

<when green flag clicked>
<forever>
<set x to( (( <{ platforms }> <+>  <{ movement }> ))


I didn't include a script to hide the sprite but you should be able to do that on your own.

That is the way I programmed the enemies in archknight's adventure  smile


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2008-01-28 20:53:28

mrbookie3
Scratcher
Registered: 2008-01-11
Posts: 8

Re: Please help somebody!!

thak u archmage/MITscratcher

Offline

 

Board footer