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

#1 2012-01-30 14:57:40

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

How to add moving objects to a scrolling game?

Hi, I'm working on a scrolling game in which will have moving platforms. I know how to make the platforms work with the scroller, but one key piece of information that I need is missing. I would like to know how I can get the platforms to move while the player is roaming and not on any of them. I know how to make a platform function vertically (y position). It's horizontally (x-position) that I'm concerned with. For example, when a player walks up to a platform, have said platform following it's path to and from point A and point B, horizontally. I cannot fathom how this can be done while the game is a scroller, being as how you have to set object's and terrain's x position to:

forever
set x to [scrollx + 480 * 0] //and add 1 for every terrain, etc.
^ with that, things only move according to it, which is why I'm confused.

Thank you for your time and I hope someone has taken the time to read this and help me! I promise to whomever helps out, you will not go un-noticed. I will look into your projects, and add a credits section to the end of the game, with your names in it!

Last edited by Zparx (2012-01-30 15:00:47)


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#2 2012-01-30 15:13:26

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to add moving objects to a scrolling game?

Wrong forum  wink


Why

Offline

 

#3 2012-01-30 15:46:28

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Offline

 

#4 2012-01-30 15:47:51

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to add moving objects to a scrolling game?


Why

Offline

 

#5 2012-01-30 16:19:55

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: How to add moving objects to a scrolling game?

This is the first topic you posted, then the second one was posted about 8 minutes later.

Last edited by rdococ (2012-01-30 16:20:21)

Offline

 

#6 2012-01-30 17:54:59

Haiming
Scratcher
Registered: 2011-08-20
Posts: 1000+

Re: How to add moving objects to a scrolling game?

I think this belongs to the help with scripts forums.

Offline

 

#7 2012-01-31 18:23:31

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: How to add moving objects to a scrolling game?

Lol, look guys, sorry for spamming but no one ever looks at my posts regardless of how many times I bump. I was just hoping that by posting more than once I could get help. It worked, but it seems I've made people.....mad? Idk, but I will try to tone down the amount of my posts (:


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#8 2012-01-31 18:25:38

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: How to add moving objects to a scrolling game?

Don't worry, I wasn't mad, I was just pointing it out  smile


Why

Offline

 

#9 2012-01-31 23:48:24

Squawkers13
Scratcher
Registered: 2010-11-20
Posts: 500+

Re: How to add moving objects to a scrolling game?

Try this:

when gf clicked
 forever
  change (scrollx) by 10
  bounce


http://pekkit.net/banners/pekkit.png

Offline

 

#10 2012-02-01 16:29:56

Zparx
Scratcher
Registered: 2011-03-23
Posts: 500+

Re: How to add moving objects to a scrolling game?

Squawkers13 wrote:

Try this:

when gf clicked
 forever
  change (scrollx) by 10
  bounce

I'm so very very confused. How would I implement that into a game ):


http://images3.wikia.nocookie.net/__cb20101119183412/halo/images/4/43/Hero2.png
^ My rank on Halo: Reach :3

Offline

 

#11 2012-02-20 13:05:11

Squawkers13
Scratcher
Registered: 2010-11-20
Posts: 500+

Re: How to add moving objects to a scrolling game?

see the scrolling demo sample project.


http://pekkit.net/banners/pekkit.png

Offline

 

#12 2012-02-20 14:40:01

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: How to add moving objects to a scrolling game?

Yes, by posting more than once of the same topic is spamming and any kind of spamming is discouraged, even for help. And the sample project of scrolling doesn't have moving objects, so that wouldn't help.

You'd have to make a script that makes it always change with the scroll x, and also make a script that makes it go back and forth (or any other movement, up/down, etc.) they have to be separate though.

Offline

 

Board footer