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

#1 2010-02-10 20:58:25

samurai768
Scratcher
Registered: 2009-07-21
Posts: 1000+

Can ask a favor?

I'm making a scroller, and I need someone to program me a tutorial for scrolling enemies. The enemies pop up randomly, and that's what I need help with. The also move on their own closer to you. Please help! (Sorry about the discription, I know it's not very good. If you have an questions, please do ask.)

Offline

 

#2 2010-02-10 21:27:28

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: Can ask a favor?

Let's see, here's what you do:

First you make a new variable for the enemy called "Xpos".  Now set up these scripts:

http://i45.tinypic.com/2igzzx5.gif

This will make him align to the scrolling, and move side to side.  Of course, change the first block of the first script to increase/decrease the area it will appear in, and change the second script to match the motion type you want.

Last edited by Kileymeister (2010-02-10 21:27:47)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2010-02-11 07:34:28

Ace-of-Spades
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Can ask a favor?

Don't make the variable called 'xpos'. I'm sure you know it does nothing. Make it something you'll remember, like Enemy Location. It's not like you'll need a Y position for the enemy unless the map goes down when you jump. (The 2 different ways of jumping you could make are: the character you control is dynamic and jumps only, or the character stays static and the backgrounds and enemies move)

Also about the random -500 to 500 thing: That would make it possible for an enemy to be right beside you or on top of you when you start the game. If you use the 'and' boolean, you can make the first part of the map a safe zone.

Last edited by Ace-of-Spades (2010-02-11 07:36:33)


11110010100011010100011010101000100011011011001010111100101000110101000110101010001000110110110010101111001010001101010001101010100010001101101100101011110010100011010100011010101000100011011011001010
110101010010001010101010101010101010101010100110101010010101010010101001101011010101010010101010101

Offline

 

#4 2010-02-11 07:41:20

fanofcena
Scratcher
Registered: 2008-07-03
Posts: 1000+

Re: Can ask a favor?

making a variable called x pos will add movement functionality to the enemy


http://i53.tinypic.com/2vxr2c0.png Click whats above u might make a cute planet happy ^_^

Offline

 

#5 2010-02-11 08:02:42

juststickman
Scratcher
Registered: 2009-05-31
Posts: 1000+

Re: Can ask a favor?

Ace-of-Spades wrote:

Don't make the variable called 'xpos'. I'm sure you know it does nothing. Make it something you'll remember, like Enemy Location. It's not like you'll need a Y position for the enemy unless the map goes down when you jump. (The 2 different ways of jumping you could make are: the character you control is dynamic and jumps only, or the character stays static and the backgrounds and enemies move)

Also about the random -500 to 500 thing: That would make it possible for an enemy to be right beside you or on top of you when you start the game. If you use the 'and' boolean, you can make the first part of the map a safe zone.

What do you mean you're sure that I know it does nothing?
People remember that.


http://is.gd/iBQi2 Add grob to your sig and help with world dominiation!http://is.gd/iBQ9Q                                                             Hey guys, we're seriously naming our team bob?

Offline

 

#6 2012-07-06 11:21:13

bonechill
Scratcher
Registered: 2012-05-02
Posts: 500+

Re: Can ask a favor?

bump


http://www.planetminecraft.com/files/sigs/scratch9p_693826_sig.jpg

Offline

 

#7 2012-07-06 11:48:10

benjamin2
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Can ask a favor?

bonechill, this topic is over 2 years old. Please don't necropost, especially when you have nothing more to offer on the topic. I've reported this to be closed.


http://i.imgur.com/gp6tZ.gif

Offline

 

#8 2012-07-06 14:51:18

bonechill
Scratcher
Registered: 2012-05-02
Posts: 500+

Re: Can ask a favor?

oops, sorry.  sad


http://www.planetminecraft.com/files/sigs/scratch9p_693826_sig.jpg

Offline

 

#9 2012-07-06 16:28:18

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Can ask a favor?

I don't think samurai768 needs help anymore - I'm closing this topic.  smile


http://i.imgur.com/WBkM2QQ.png

Offline

 

Board footer