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

#1 2010-12-12 16:07:48

meowza
Scratcher
Registered: 2010-08-24
Posts: 11

scrollers with enemies

how do i make a scroller with enemies that move? because in the tutorial I saw to make a scroller, it had a forever block and that would make it so that it cant move..

Offline

 

#2 2010-12-12 16:20:37

NeoAtVic
Scratcher
Registered: 2010-10-04
Posts: 67

Re: scrollers with enemies

I've never personally done this before but i'll try to help.

If the enemies are "standing still" and the world is moving then you would expect the enemies to move with the world so that from their point of view they aren't moving.
To do this you would have to move the enemies WITH the world.
If you are using the scrollX method to move the world then simply move the enemies by that much as well  smile

Hope thats clear enough  smile


http://farm3.static.flickr.com/2796/4519763712_5fab3a6935_o.png

Offline

 

#3 2010-12-12 16:37:48

meowza
Scratcher
Registered: 2010-08-24
Posts: 11

Re: scrollers with enemies

i want the enemy to move apart from the world, not with the world..

Offline

 

#4 2010-12-12 16:47:13

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

Re: scrollers with enemies

Use that script where they move with the world, and then make a variable called "Xpos" or something similar.  Have a block that looks like this:

http://i55.tinypic.com/xd9nvt.gif

As you can see, it's X and Y positions are affected not only by a scrolling variable, but by this new variable.  Changing this new variable while the script is active is the same as having it move, even when scrolling.

Note: When scroll X and Y equal 0, these new variables will be their true positions, but then they are affected by scrolling.


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

 

Board footer