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

#1 2007-08-27 15:52:35

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Please Help!

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


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#2 2007-08-27 16:11:29

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: Please Help!

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.


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

#3 2007-08-27 16:24:16

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: Please Help!

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.


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#4 2007-08-27 16:49:19

AlveKatt
Scratcher
Registered: 2007-08-12
Posts: 100+

Re: Please Help!

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

 

#5 2007-08-27 17:06:48

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: Please Help!

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)


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#6 2007-08-27 18:26:58

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Please Help!

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  tongue

Last edited by archmage (2007-08-27 18:35:19)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#7 2007-08-27 18:42:22

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: Please Help!

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


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#8 2007-08-27 18:55:50

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Please Help!

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.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#9 2007-08-27 19:06:59

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: Please Help!

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


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

Board footer