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>
Offline
Please move this to the "all about scratch" Section.
Offline
I sent a report to move the thread.
Last edited by ihaveamac (2010-08-01 00:26:43)
Offline
This belongs in All About Scratch, yes. ^^
Offline
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.
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)
Offline
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)
Offline
Try this:
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.
Offline
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)
Offline
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.)
Offline
iruni180 wrote:
Could you elaborate on:
Harakou wrote:
Just make a separate script that changes the position variable.
![]()
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)
Offline