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

#1 2008-07-02 18:42:41

gnomick
Scratcher
Registered: 2008-01-02
Posts: 8

Need help here on my scrolling game

I have trobule making a scrolling game... Can anybody help please?

This is the script for the player sprite:

<when green flag clicked>
<set{ yvelocity }to( 0
<go to x sad  -213 )y sad  0
<forever>
<change y by( <{ yvelocity }>
<if><key[ right arrow ]pressed?>
<if><( <x position> <=> -1 )>
<if><( <{ Scrollx }> <>> -480 )>
<change{ Scrollx }by( -3
<end>
<else>
<change x by( 3
<end>
<if><key[ left arrow ]pressed?>
<if><( <x position> <=> -1 )>
<if><( <{ Scrollx }> <<> 0 )>
<change{ Scrollx }by( 3
<end>
<else>
<change x by( -3
<end>
<change{ yvelocity }by( -1
<end>

The sidescrolling never occurs if the player sprite's X position is 0. Can somebody please find a solution to this problem, please?


Email me at rather-not-say@scratchr.com.

Offline

 

#2 2008-07-10 06:44:15

tro95
Scratcher
Registered: 2008-02-20
Posts: 78

Re: Need help here on my scrolling game

Is there any chance you could post the current project online and tell me the URL. Also if you give me an idea of what type of game you wish to make and I might be able to help.


Eureka!!!! It's obvisous. You have put if (( X-position ) = -1 ), it needs to be       
(( X-position ) = 0 )

Last edited by tro95 (2008-07-10 06:53:05)

Offline

 

#3 2008-07-10 08:17:31

Lanie
Scratcher
Registered: 2008-02-03
Posts: 1000+

Re: Need help here on my scrolling game

I will move this topic to this section:  All About Scratch

Offline

 

Board footer