Is it normal for sprites in scrolling games to always stay on the edge of the screen?
It's like if I walk away from something it'll move away but you can still see it at the edge of the screen?
Am I making sense o.o?
Offline
you mean how the terrain doesn't scroll all the way off the edge of the screen and it just stays on the edge?
Yeah, that happens.
Offline
You could try 'if touching edge, hide'. That... *might* do it.
Offline
Scratcher456 wrote:
You could try 'if touching edge, hide'. That... *might* do it.
No, it wouldn't.
Offline
That's what I was afraid of... I really know NOTHING about scrollers, they've never been my thing to make.
Offline
That is one way to do it, but here is a script scrollers commonly use.
when gf clicked forever go to x: ((scroll x) + ([480] x [0])) y: ((scroll x) + ([480] x [0])) if <<([abs v] of (x position)) > [460]> or <([abs v] of (y position)) > [340]> hide else show endIf the object still doesn't hide while off screen, click on it, look at its x and y positions, and adjust the greater than numbers to a little below what you see.
Last edited by sonicfan12p (2012-08-24 01:03:47)
Offline
sonicfan12p wrote:
That is one way to do it, but here is a script scrollers commonly use.
when gf clicked forever go to x: ((scroll x) + ((480) * (0))) y: ((scroll x) + ((480) * (0))) if <<([abs v] of (x position)) > [230]> or <[170] < ([abs v] of (y position))>> hide else show endIf the object still doesn't hide while off screen, click on it, look at its x and y positions, and adjust the greater than numbers to a little below what you see.
Edit: where it says or, it cuts off. It is the same as the first part, with x poistion changed to y position, and the number changed to 340.
Fixed. That is a really annoying glitch. :3
Offline
Yes. Yes it is very annoying.
Offline
So for your question about scrolling... ya your making sense and ya that's normal. One way of dealing with it is adding a border to your project to hide the terrain on the edges!
Offline
I usually add a black border around my game to fix that, but there are ways to fix it with scripts too.
Offline