Discuss Scratch

JAVAProgramming
Scratcher
100+ posts

Sprite Going Through Black?

My sprite is going through the black.


Can anyone help me?

This game is here.

Last edited by JAVAProgramming (Oct. 10, 2013 18:24:12)


My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
drmcw
Scratcher
1000+ posts

Sprite Going Through Black?

That's one of the common scrolling problems. Scratch doesn't let a sprite go completely off the screen even if the x, y coordinates you give it should make it go off. Various fixes are to add a border around the edge to cover the showing edges of sprites, detect when the x position is far enough over to then hide the sprite or adding transparent edges to the sprite so that the visible bits do go off stage. Find a scroller you like the look of and see how they do it for ideas.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
JAVAProgramming
Scratcher
100+ posts

Sprite Going Through Black?

drmcw wrote:

That's one of the common scrolling problems. Scratch doesn't let a sprite go completely off the screen even if the x, y coordinates you give it should make it go off. Various fixes are to add a border around the edge to cover the showing edges of sprites, detect when the x position is far enough over to then hide the sprite or adding transparent edges to the sprite so that the visible bits do go off stage. Find a scroller you like the look of and see how they do it for ideas.
OK, thanks!!

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
scubajerry
Scratcher
1000+ posts

Sprite Going Through Black?

JAVAProgramming wrote:

My sprite is going through the black.


Can anyone help me?

This game is here.
I see you edited your post. I an not sure if you changed your question, but the previous answer doesn't appear to be related to your current question. In answer to this question, if you change your code to IF TOUCHING BLACK, SET Y VEL to 1, instead of the 0, you currently have takes care of most of your problems. It doesn't work with the “cave” that you currently have in your project.
JAVAProgramming
Scratcher
100+ posts

Sprite Going Through Black?

scubajerry wrote:

JAVAProgramming wrote:

My sprite is going through the black.


Can anyone help me?

This game is here.
I see you edited your post. I an not sure if you changed your question, but the previous answer doesn't appear to be related to your current question. In answer to this question, if you change your code to IF TOUCHING BLACK, SET Y VEL to 1, instead of the 0, you currently have takes care of most of your problems. It doesn't work with the “cave” that you currently have in your project.
What do you mean?

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
scubajerry
Scratcher
1000+ posts

Sprite Going Through Black?

JAVAProgramming wrote:

scubajerry wrote:

JAVAProgramming wrote:

My sprite is going through the black.


Can anyone help me?

This game is here.
I see you edited your post. I an not sure if you changed your question, but the previous answer doesn't appear to be related to your current question. In answer to this question, if you change your code to IF TOUCHING BLACK, SET Y VEL to 1, instead of the 0, you currently have takes care of most of your problems. It doesn't work with the “cave” that you currently have in your project.
What do you mean?

Which part? The editing part, is because drmcw's answer is about what to do when your sprite gets near the edge of the screen.

As far as the code change, look at your code and you should see what I said.

JAVAProgramming
Scratcher
100+ posts

Sprite Going Through Black?

scubajerry wrote:

JAVAProgramming wrote:

scubajerry wrote:

JAVAProgramming wrote:

My sprite is going through the black.


Can anyone help me?

This game is here.
I see you edited your post. I an not sure if you changed your question, but the previous answer doesn't appear to be related to your current question. In answer to this question, if you change your code to IF TOUCHING BLACK, SET Y VEL to 1, instead of the 0, you currently have takes care of most of your problems. It doesn't work with the “cave” that you currently have in your project.
What do you mean?

Which part? The editing part, is because drmcw's answer is about what to do when your sprite gets near the edge of the screen.

As far as the code change, look at your code and you should see what I said.

I tried that, and it doesn't work… He goes right through the black background

My Newest Project, Come Check It Out
Dots, On Scratch
Want to change the way we count? The Dozenal System.

“The story so far:
In the beginning the Universe was created.
This has made a lot of people very angry and been widely regarded as a bad move.”
― Douglas Adams, The Restaurant at the End of the Universe
scubajerry
Scratcher
1000+ posts

Sprite Going Through Black?

JAVAProgramming wrote:

scubajerry wrote:

JAVAProgramming wrote:

scubajerry wrote:

JAVAProgramming wrote:

My sprite is going through the black.


Can anyone help me?

This game is here.
I see you edited your post. I an not sure if you changed your question, but the previous answer doesn't appear to be related to your current question. In answer to this question, if you change your code to IF TOUCHING BLACK, SET Y VEL to 1, instead of the 0, you currently have takes care of most of your problems. It doesn't work with the “cave” that you currently have in your project.
What do you mean?

Which part? The editing part, is because drmcw's answer is about what to do when your sprite gets near the edge of the screen.

As far as the code change, look at your code and you should see what I said.

I tried that, and it doesn't work… He goes right through the black background
Look at my remix. The only place it goes through the wall is the cave on the right. Is this what you are seeing?
scubajerry
Scratcher
1000+ posts

Sprite Going Through Black?

Powered by DjangoBB