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

#1 2013-01-06 20:10:37

FreddyKruger24
Scratcher
Registered: 2012-10-03
Posts: 4

I need help

Well I am trying to make a side scrolling, multiple stage, and moving obstical game. I need help on how to do all of this. I would like If people could do it all in sprate posts like 1st one explain how to side scroll 2nd multiple stage ect. Thank You to all that look at this.

Offline

 

#2 2013-01-06 20:47:40

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: I need help

FreddyKruger24 wrote:

Well I am trying to make a side scrolling, multiple stage, and moving obstical game. I need help on how to do all of this. I would like If people could do it all in sprate posts like 1st one explain how to side scroll 2nd multiple stage ect. Thank You to all that look at this.

Although I can't help much due to how late it is, here is a nice wiki article on scrolling.

I hope that this helps! Also, hello FreddyKruger24 and welcome to Scratch! I wish you good fortune on learning how to code!


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2013-01-07 20:42:44

switenky
Scratcher
Registered: 2009-06-28
Posts: 100+

Re: I need help

I know how. But it would be too long to type here. All I can help you:

You can learn by doing scrolling code here.

Or download this project.

Last edited by switenky (2013-01-07 20:43:50)


http://scratch.mit.edu/static/projects/switenky/769464_med.png DIG DUG

Offline

 

#4 2013-01-08 17:36:56

iNKGaming
New Scratcher
Registered: 2012-07-18
Posts: 18

Re: I need help

I see the others have posted a couple handy links to projects, and wiki articles for creating scrolling backgrounds, so I'll skip that. I'd recommend the wiki article in particular, though, because it explains how it works. Here's a quick rundown of how to implement obstacles, however -

-- Static Objects/Non-moving Obstacles --
As you should know after finishing the article, scrolling backgrounds rely on a base variable, possibly called "XPosition" I.E. background 1's x position is a variable "XPosition" and background 2's is "XPosition + 480" - therefore, say you'd like to place a static object halfway across the screen - simply set it's x position to being "XPosition + 240", and when the backgrounds scrolls, it should stay in its proper place, relative to the background.

As soon as "XPosition" exceeds or drops below a certain value, the object should hide. However, when it's within the correct parameters, it should be made to show. So for the example above, our static object should hide when "XPosition" is 240, because then it'll be at the edge of the screen, and likewise, when it reaches -240.

-- Non-Static Obtacles/Moving enemies ---
For moving objects I'd recommend adding another variable such that the new position code is "XPosition + [ Offset ] + "Movement", and then change the movement variable's value in another script. This will keep the object in the proper place relative to the screen, while still allowing it to move.

Happy scratching,
- iNK

Offline

 

#5 2013-01-09 06:43:36

ethwok
Scratcher
Registered: 2012-09-10
Posts: 100+

Re: I need help

Basic script, is that you have a var that tells you where you are in the level, so name it placement or something, and when you press the right arrow key, change it by 1. When you press the left arrow key, change it by -1. Also have the 2 ground sprites that go across the screen, have one start in the middle, and the other one way of scrunched to the side where you cant see it. Make this sprite for both of them. Forever if right arrow key pressed, move x position -(however many degrees you want), and when the left arrow key pressed move x position (however many degrees you want). And to have the items show up when you walk through the level is that you tell it

     when gf clicked
hide
wait until placement = 300(or something else)
show
forever
   if
     right arrow key pressed, move x position -(however many degrees you want)
   if
left arrow key pressed move x position (however many degrees you want)

HOPE THIS HELPS!

Last edited by ethwok (2013-01-09 06:43:52)


http://displaypicks.com/wp-content/uploads/2013/01/Animals-12.jpg
I AM ETHWOK

Offline

 

Board footer