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

#1 2008-06-26 16:18:08

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Another Scrolling Problem

Hey!  smile

My game is a rocket ship that moves upwards, of the ground, and has to move direction between a lot of obstactles, using the arrow keys. I am using scrolling for this game as it looks a lot better like it!

The ship moves by changing the "scrollY" varible. When the scrollY varible moves, the Y co-ordinate of the sprite moves.

That works, but when I want the ship to change direction and carry on moving in the direction, it doesn't move it just continues moving upwards. Now you may be thinking, yea but just make it "move 10 spaces" or something like that. However, that doesn't work as then the Y co-ordinate of the ship increases, which will eventually move it off the screen.

My question is, How do I make it so that the ship still moves in a direction, but not move the y co-ordinates.

If that makes sense  tongue

~ Dan01


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#2 2008-06-26 16:20:02

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

[blocks]<point in direction( [/blocks]


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#3 2008-06-26 16:21:29

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

But the space ship doesn't move in that direction, it keeps moving vertical.

Lemme upload it and I'll show you.

http://scratch.mit.edu/projects/Dan01/198468

Last edited by Dan01 (2008-06-26 16:22:55)


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#4 2008-06-26 16:22:46

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

Dang. I dislike looking at projects (because of Lag and lack of Java. But sure, I'll see)


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#5 2008-06-26 16:22:55

smileemzi
Scratcher
Registered: 2008-06-26
Posts: 6

Re: Another Scrolling Problem

<when[ right arrow ]key pressed>
<forever>
  <point in direction( 90 )
  <move( 10 )steps>
<end>

Offline

 

#6 2008-06-26 16:49:34

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Still need help....

~ Dan01


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#7 2008-06-27 12:27:52

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Bump!


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#8 2008-06-27 15:13:16

PokemonMaster64
Scratcher
Registered: 2008-04-28
Posts: 70

Re: Another Scrolling Problem

<say[ I think the problem is that when you turn the ship and press up, the ship can't <move( 10 )steps>, because it Changes <y position> as well as <x position>? Maybe You should look at a project like privateer... i looked at the script and it made me dizzy, but maybe you could understand it...
I wish I could <set[ My lack of knowledge in this type of scrolling ]effect to(0

Last edited by PokemonMaster64 (2008-06-27 15:20:12)


Front Page: A goal I will never reach. The life of the unnoticed scratcher is sad indeed.
Let's hope the system improves.

Offline

 

#9 2008-06-27 16:00:31

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Still need help...


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#10 2008-06-27 16:13:48

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

If I'm not mistaken, I just looked at it. Did you make a seperate script that says, whenver something is pressed, move 1 step? like:

[blocks]<point in direction( <direction>[/blocks]
[blocks]<move( 1  )steps>[/blocks]?


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#11 2008-06-27 16:15:33

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

But that's the problem...

I don't want it to move 1 step, because then the y co-orindate will increases, eventually causing it off the screen.

I bascically want something that moves the ship in the direction, but doesn't change the y co-ordinate.

If you can? O_o.

~ Dan01


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#12 2008-06-27 16:16:25

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

Dan01 wrote:

But that's the problem...

I don't want it to move 1 step, because then the y co-orindate will increases, eventually causing it off the screen.

I bascically want something that moves the ship in the direction, but doesn't change the y co-ordinate.

If you can? O_o.

~ Dan01

Easy, change the X instead of the Y


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#13 2008-06-27 16:19:13

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

So i create something like this?

<when green flag clicked>
<forever if><key[right]pressed?>
<if> direction > 45


<else>
<point in direction( (( direction <+> 1 ))
<change x by( 1 )
<wait( 0.1 )secsc>


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#14 2008-06-27 16:20:07

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

Dan01 wrote:

So i create something like this?

<when green flag clicked>
<forever if><key[right]pressed?>
<if> direction > 45


<else>
<point in direction( (( direction <+> 1 ))
<change x by( 1 )
<wait( 0.1 )secsc>

Ummm... not sure why blank blocks there, but yes. And maybe use velocity for realistic-ness.


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#15 2008-06-27 16:22:22

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Thanks! ^_^

You've actually made it better than I thought it would be  tongue

You're good. Lol.

Thanks again

~ Dan01


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#16 2008-06-27 16:24:13

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

Dan01 wrote:

Thanks! ^_^

You've actually made it better than I thought it would be  tongue

You're good. Lol.

Thanks again

~ Dan01

Wow. It worked? Cool. I just thought since you were changing your X but, wow!


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#17 2008-06-27 16:33:45

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Hehe.

I think that's all the problems fnished!

So the next time I talk to you, it will be showing you the finished game  tongue

~ Dan01


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#18 2008-06-27 16:35:54

Bluestribute
Scratcher
Registered: 2008-01-24
Posts: 1000+

Re: Another Scrolling Problem

Dan01 wrote:

Hehe.

I think that's all the problems fnished!

So the next time I talk to you, it will be showing you the finished game  tongue

~ Dan01

I hope you add a longer level  tongue !


http://img247.imageshack.us/img247/1204/bluestributett4.jpg
That's my PSN ID. I know tons of COD4 glitches. Add me as your friend. Oh, and get a headset

Offline

 

#19 2008-06-27 17:09:46

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Just uploading the preview  wink


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

#20 2008-06-27 17:17:14

Dan01
Scratcher
Registered: 2008-06-11
Posts: 100+

Re: Another Scrolling Problem

Heres the http: http://scratch.mit.edu/projects/Dan01/199606


http://img3.imageshack.us/img3/4743/ubd6522wp8.png
http://img3.imageshack.us/img3/4667/ubd3758ox2.png

Offline

 

Board footer