Calculator Community > ASM
ASM: How do I "scroll" sprites down the screen? (TI 83/83 plus/84plus)
Jerros:
Title says it all...
I'm making a game in ASM, but I'm really new to programming, and I can't make a proper working piece of scipt that scrolls sprites down the screen.
I'm making a guitar-hero like game, where "O" start at the top of the screen, scroll down at a certain speed, and when the "O" matches an "O" in the bottom of the screen, you must press a certain button.
Requirements are:
- It must be possible to drop down some "O" sprites in a specific order, not just randomly. So I can determine the time between each "O" falling down.
- While the "O" is dropping, the Calc must still respond to a keypress, and execute a script when a button is pressed (to see if you pressed the right button at the right time, and increase/decrease score accordingly).
I hope I've been clear about what i'm trying to do.
If anyone could help me out by giving tips, or making a small script that performs a piece of what I want, it'd be a great help!
Thanks in advance!
mapar007:
Use the regular putspritexor routine (from the asmin28 tutorial) for the displaying of the O, and increment the y-coordinate of the sprite every time you want it to move down.
(sorry, no time for thinking up examples)
Jerros:
Uhu, but you don't have controle while the "redraw-sprite" routine is going on.
So I'd have to increment the y-coordinate, then check for a button, then inc. Y again ect?
The redraw routine would take very long when there are lots of sprites to redraw, and the keypress of the user wouldn't be registerd on the exact time I put a "check keypress" routine between the redraw routines...
And whats the Key command to check if a button is held down, not just pressed?
The whole "perform scripts while a button is pressed down and do something else if not" concept is unfamiliar to me...
More specifically, how to handle multiple sprites???
Also, there's still the problem of how I manage multiple sprites that way...
I want it to be possible to scroll down a number of sprites in a specific order with a varying time interval between them that I can set.
I hope I'm clear (probably not...) and I appreciate your help.
Thank you for your reply!
mapar007:
Very long? nononono, it's just a few microseconds (or milliseconds for that matter). You don't notice, normally.
Quigibo:
Jerros, I don't think you have a clear understanding of how that assembly routine works. First of all, drawing an 8x8 sprite fully clipped onto the buffer literally takes less than a millisecond. You don't actually have to refresh the screen until you have finished drawing all the sprites. Your layout should be something like this:
Loop:
<Draw Sprites>
<Refresh Screen>
<Pause For Timing>
<Handle Key Presses>
<Sprite Movement>
jp Loop
It sounds like you're pretty new to assembly. You might want to start a little slower becasue you're trying to do some complicated things that are going to be very confusing without a lot of experience.
Navigation
[0] Message Index
[#] Next page
Go to full version