I tried to spend the weekend learning the basics (ha!) of IntyBasic. And what better way to learn for a "retro" console than to make a PONG clone? So I made a very rough PONG clone called "PONGadelic" to learn:
- Simple sprite definition and rendering.
- Controller input and translating input to sprite movement.
- Simple collision detection.
- How to handle color-switching on the Inty.
I've attached the BAS and ROM files for your perusal. The PONGadelic_title.BAS simple renders the classic title screen (adapted from the SDK's classic title screen example - thanks!).
So down to my questions - I've got the Inty in ColorStack mode:
MODE SCREEN_COLOR_STACK, STACK_BLACK, STACK_CYAN, STACK_BROWN, STACK_YELLOW 'I have no idea how to use anything after STACK_BLACK BORDER BORDER_BLACK
This results in my entire play field being BLACK, which is what I want for now. Great. But say, after either player scores a point, I want to change the whole play field to the next color in the stack - that is everything that was STACK_BLACK should now be STACK_CYAN. I was not able to figure out how to accomplish this. Is there some sort of "advance color stack to next color" command? I saw something about setting $2000 but I'm not sure how or where to do that. I don't want to change the color of a sprite or printed object; I want to make the entire play field a new color.
Second question - I have a Ball object (SPRITE 6) that I want to animate in a simple, back-and-forth kind of deal. I have two sprites loaded into GRAM for this purpose; SPR03 and SPR04.
SPRITE 6,ballX+HIT+VISIBLE,ballY+ZOOMY2,SPR03 + ballColor 'this is where Id like to animate the ball, (i.e. change to SPR04 for X frames, wait X frames, then change back to SPR03).
My assumption is we need some kind of counter that switches the line from using SPR03 to SPR04 every X frames, then starts over and switches back to SPR03 after X frames elapse again - but I struggled with how to implement this. When I had counters swapping the sprites, I ran into collision detection issues.
Final question - WAITs - I don't really understand when I should (and shouldn't) be using them. I understand that certain things need to "settle" sometimes, or you can only do certain operations once every "cycle"... but I'm kind of lost .
Besides those (probably obvious!) questions, PONGadelic is a totally functional albeit rough PONG clone! If you feel like trying it out, here's how it works:
- Classic PONG - use your paddle to bounce the ball and prevent it from going out the back of your side.
- Left Controller - Left Side; Right Controller - Right Side.
- Player who just gave up a point gets to "serve" the ball using any of the Side Buttons (serving merely sends the ball in a random direction from the center).
- When the game first starts, Left Player gets to "serve".
- First player to 9 points wins the game.
- Walls, Paddles, and Ball have a random color during each round of the game (hence PONGadelic).
Thanks in advance for your help!
Edited by jlew715, Sun Dec 9, 2018 9:28 PM.