http://scratch.mit.edu/projects/soccrplyer4life13/30252
This project is frustrating the snot out of me, and I would really appreciate it if some people could figure out why my side scrolling isn't working. Yes, I've looked at everyone's examples, and no, I still can't get it. Please just take a look at it and tell me where I'm missing something. I am quite frustrated by it and would like some new eyes to look at it and tell me what I'm doing wrong.
Thank you very much, I greatly appreciate your help.
Soccrplyer4life13
Offline
Alright. I have no experience with side scrolling, but it could make a difference if you do this. On the maps, make the scripts with the right arrow 2 separate ones. Especially the ones near where the break is.
This might work, it might not.
You might also want to create a 2nd file to play around with.
Offline
I guess I don't understand what you're saying. From what I can figure, it's kinda being random as to whether the next map will show up and stay where it should be, so sometimes it will work, and other times it won't...and for some reason all of the maps move down a pixel or two at a specific spot...which isn't anywhere in my code (to my knowledge). So basically the whole thing is just being really random and unpredictable.
Offline
I think it could be as easy as that you need to get rid of the = sign in the map scripts. Try If x position is less (<) than 0? Also, to get better performance you need to hide the maps that scroll out of view, among other things.
It moves in increments of three steps. The reason it only works sometimes is that because you use an = sign it jumps past it two times of three. The positions can be -2, -5, -8, -11, -14, -17, -19, oops, it skipped -18, which means it didn't change the MapNo. value or broadcast for the next map!
Take a look at the rescue ship code that Mayhem fixed up for me. If you can figure that out it should be easy peasy to make it move in one dimension.
Edit: And while I am at it, what's the point of that forever, wait 0.01 seconds in sprite four? It does nothing but eat up resources, that I can see at least...
Last edited by AlveKatt (2007-08-27 17:02:49)
Offline
the forever will have that music block in it for the final version, and i always hear that putting in a wait into a forever actually eats up less resources. I thought I had tried the < thing, but i'll re-look at it and see if that fixes things. Thanks.
my guess is that by putting in a less than it will constantly broadcast, putting me into an infinite loop.
edit: i've looked at mayhem's code and can't for the life of me figure out how to implement it into what I have, so if someone can do that, i'm sure his code is the best way to do it.
Last edited by soccrplyer4life13 (2007-08-27 17:27:29)
Offline
Well I was looking at it and you REALLY overcomplicated it. It had a lot of unnecessary broadcasts and an unnecessary variable. For this type of side scroller where it can only scroll to one side the hiding of area sprites is very simple, just use layers to make them overlap. I fixed your project and the fixed version can be found @ http://scratch.mit.edu/projects/archmage/32358
The best solutions are sometimes the simplest
Last edited by archmage (2007-08-27 18:35:19)
Offline
Thank you very much...now, (realize i haven't looked real close at your example b/c i'm at work) the xplace variable, is that as far right as it can be, or can it adjust it a bit more, because with the numbers you have, parts of the pictures at the overlaps gets cut off.
Thank you VERY VERY much though, yeah, i tend to overcomplicate things quite often, but i really appreciate the help.
Thanks
Offline
The xplace variable determines how far the object goes to the right. You can adjust those numbers slightly but make sure you don't raise them too much or the pictures will have gaps between them.
Offline
right, i just spent quite a bit of time making sure that the areas at the breaks would look seamless, so i was just making sure that i could freely move those numbers. Thank you again
Offline