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

#1 2010-08-01 00:14:01

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Moving object in scroller

I am trying to add an enemy in my scroller. I can't figure it out.
All I could get was:
<when green flag clicked>
<point in direction( 90
<repeat( 10
<set x to( (( <{ Scrollx }> <+> (( 480 <*> 0.8 )) ))
<end>
<point in direction( -90
<repeat( 10
<set x to( (( <{ Scrollx }> <+> (( 480 <*> 0.8 )) ))
<end>


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#2 2010-08-01 00:17:04

half_life_2
Scratcher
Registered: 2007-07-19
Posts: 1000+

Re: Moving object in scroller

Please move this to the "all about scratch" Section.


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

Offline

 

#3 2010-08-01 00:25:57

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Re: Moving object in scroller

I can never get that right for some reason.


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#4 2010-08-01 00:26:33

ihaveamac
Scratcher
Registered: 2007-09-22
Posts: 1000+

Re: Moving object in scroller

I sent a report to move the thread.

Last edited by ihaveamac (2010-08-01 00:26:43)


~ihaveamac - visit ihaveamac.net

Offline

 

#5 2010-08-01 00:28:50

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Re: Moving object in scroller

Thank you.


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#6 2010-08-01 04:14:33

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: Moving object in scroller

This belongs in All About Scratch, yes. ^^


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#7 2010-08-01 11:23:49

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Moving object in scroller

upload the project, post a link here and we will help you with lightening speed


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#8 2010-08-01 16:52:16

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Re: Moving object in scroller

http://scratch.mit.edu/projects/iruni180/1184191


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#9 2010-08-01 16:56:50

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Moving object in scroller

just saw your post, will take my dial-up about 10 minutes to download then a few more minutes to figure something out and reply, be back in a few

arggghh, first download was a bad file, trying again, sorry
and my 2nd try was also a bad file?

I've had plenty of problems uploading to Scratch but this is the first time I've had problems downloading. I will keep trying.  sad

3rd time also failed. Every attempt "appears" to finish downloading successfully and even saves the project file in my Downloads but they all stop between 1.7 and 2 Megs, literally with around 40 seconds of download time remaining. Very frustrating. I will reboot, reconnect, and try again.

Last edited by Locomule (2010-08-01 17:38:48)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#10 2010-08-01 18:13:27

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Moving object in scroller

4th try after pc reboot, worse than the last 3 attempts (1.6Megs retrieved)

so I am terribly sorry, I will have to try again in a few hours maybe

And this may be my 'dumbest' theory posted yet on Scratch but my uploads have been basically ruined since Nov 2009 and so have many other people's. I strongly suspect that increased users and server loads resulted in server tweaks by the Scratch Team , that have unfortunately worked against people who do not have broadband. Consider it an educated guess, nothing more.

Last edited by Locomule (2010-08-01 18:13:51)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#11 2010-08-01 21:52:34

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Moving object in scroller

Try this:

http://i26.tinypic.com/nlu8v8.gif

This just uses the same script as the scroll terrain sprite it is located on, but uses the "position" variable to change its position relative to the terrain. Just make a separate script that changes the position variable.  big_smile


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#12 2010-08-02 14:19:47

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Re: Moving object in scroller

Well that will probably help quite a bit. Thank you Harakou.
And to Locomule thanks for trying


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#13 2010-08-02 15:05:10

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Moving object in scroller

Ever since they temporarily disabled uploads a week or 2 ago, my downloads have been messed up but not like the problem I keep having with this project. They get to 100% and then keep going for about half as long as they have already been transferring while it says "Unknown time remaining", then they finish.

I tried someone else's 1.8M project today and it did that "extra long" weirdness. Even though the server is sending my browser bad file size nfo, at least the download still worked. So I just tried Irunan Castle again and same thing, an incomplete project file that appears to have finished just fine.

Of 7 attempts, here are the file sizes I've ended up with... 1.8M (3 times), 1.6M, 1.7M, 2M, and 1.9M
obviously it gets really close to finishing. I started a post in Troubleshooting but I never seem to get anywhere there.

Which makes me extremely glad Harakou was able to help you!

For anyone interested, here is my post in Troubleshooting about the latest round of download problems.

Last edited by Locomule (2010-08-02 15:25:03)


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#14 2010-08-02 15:54:13

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Moving object in scroller

Ok, does the enemy move?  Than all you have to do is this:

go to x: scrollx + myx, y: scrolly + myy
if  abs (x pos.) > 240 or abs (y pos.) > 180
   hide
else
  show
change (myx) by abs (x pos.)/(x pos.)
change (myy) by abs (y pos.)/(y pos.)


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#15 2010-08-04 23:25:21

iruni180
Scratcher
Registered: 2009-03-10
Posts: 31

Re: Moving object in scroller

Could you elaborate on:

Harakou wrote:

Just make a separate script that changes the position variable.  big_smile

It won't work for some reason.


Want to help with Irunan Castle? Go here:
http://irunancastlegames.webs.com/

Offline

 

#16 2010-08-04 23:42:17

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Moving object in scroller

iruni180 wrote:

Could you elaborate on:

Harakou wrote:

Just make a separate script that changes the position variable.  big_smile

It won't work for some reason.

Well, if you want it to move 10 steps to the left of the point it starts at, just change "position" by -10. Note that the part of the equation that looks like this: (480 * 1) correlates with the scroll sprite you want it to be on by default. For example, if you want the enemy to be located by default on the 3rd terrain sprite, set that part of the equation to (480 * 2)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer