Gameboy Development Forum

Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)

You are not logged in.

#1 2021-02-28 22:09:34

Multifaceted.Abnormal
Member
Registered: 2021-02-21
Posts: 10

Sprite moving like an falling accordion

I have a main menu background that has the following selections:

Continue
New
Load
Options

Behind that, I have a selector bar made that is eight tiles wide to highlight the current selection.  I works but when it moves to the next selection it bends as it moves down to the next option.  I like the way it's being rendered now because when the up or down arrow is held, it moves on screen.  I can eliminate or significantly reduce the bowing affect by turning off sprites doing the move, and then turning the sprites back on.  This, however, makes it so that if a button is held down, the selector isn't shown on screen.

I read of the mysterious scroll_sprite function but it seems to work very different to move sprite function.  My question is simple: will scroll_sprite do what I'm trying to do: eliminate or reduce the bend while retaining the movement the way it is: to smoothly move all 8 tiles of the selector sprite up and down?  Or, should I look elsewhere?

Do you know a good way to render this?  I know this may seem a fundamental thing I'm asking but it's something I honestly don't know and trying to learn about.  I appreciate any assistance you can render.  Or just tell me to bugger off and I will.

Cheers.

Offline

 

#2 2021-03-01 10:30:27

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: Sprite moving like an falling accordion

we are speaking about GBDK, right? move_sprite(n, x, y) moves sprite n to absolute coordinates x and y, while scroll_sprite(n, dx, dy) moves sprite n by dx and dy offsets relatively to it's previous position.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson