Learn6502 Posted November 28, 2023 Share Posted November 28, 2023 I'm new to INTY Basic and have a question about sprites. Below are 2 lines from my first program. All it does is move a few sprites around the screen. My question is about the line for SPRITE 3. When I run the program, sprite 3 does not appear, and I can't figure out why not. Sprite 2, and Sprites 0 and 1, appear correctly. SPR05 is in the code the same way as all the others. Does anyone notice and error in the line for sprite 3? SPRITE 2, X + VISIBLE, Y, SPR04 + SPR_GREEN SPRITE 3, X + VISIBLE, Y+10, SPR05 + SPR_RED I have the Inty Basic Programming book on order, but it hasn't arrived yet. Once I have it, I'm sure it will answer my question. Thanks. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted November 28, 2023 Share Posted November 28, 2023 Hello, and welcome! I don’t see anything specifically wrong, but a couple of possible culprits come to mind: What is the value of Y? If Y + 10 is greater than 96, the sprite may not appear because it is beyond the bottom of the screen. Have you loaded SPR05 into GRAM using DEFINE? If the fifth card slot in GRAM is blank the sprite may appear, but would be essentially invisible (i.e., it would show a blank card). You could easily find out if any of the other are a problem by making one or the other register fields the same as for SPRITE 2, to isolate the variables. dZ. Quote Link to comment Share on other sites More sharing options...
Learn6502 Posted November 28, 2023 Author Share Posted November 28, 2023 No, I did not do anything with GRAM and DEFINE. I mostly copied from one of the examples and made changes to it. Thanks for your comments. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted November 29, 2023 Share Posted November 29, 2023 2 hours ago, Learn6502 said: No, I did not do anything with GRAM and DEFINE. I mostly copied from one of the examples and made changes to it. Thanks for your comments. Well, that may be something. The SPR05 argument sets the sprite to point to the 5th slot in GRAM. By the way, if you do not understand any of these terms, or if anything I've said is confusing, please feel free to let me know. I can walk you through all of this. In the meantime, if you share the rest of your code, we may be able to help find out what is wrong or missing. dZ. Quote Link to comment Share on other sites More sharing options...
Coldheat Posted November 29, 2023 Share Posted November 29, 2023 I have been lurking for years in the forums, Also been working with intybasic a lot this year. So take this with a grain of salt since I am not as experienced as others here. I had this problem before and all I did was add a WAIT statement after my sprite. Maybe its as simple as that or something else. Quote Link to comment Share on other sites More sharing options...
+DZ-Jay Posted November 29, 2023 Share Posted November 29, 2023 4 hours ago, Coldheat said: I have been lurking for years in the forums, Also been working with intybasic a lot this year. So take this with a grain of salt since I am not as experienced as others here. I had this problem before and all I did was add a WAIT statement after my sprite. Maybe its as simple as that or something else. That could be, but if it is, then there is a bigger problem with the code. Ideally you would want to update all your sprites in the same frame, so if one is being displayed in one frame, and the other in another frame; then you may want to re-evaluate your initialization routine. dZ. Quote Link to comment Share on other sites More sharing options...
carlsson Posted November 29, 2023 Share Posted November 29, 2023 Yes, sprites won't appear until in the next frame but surely there would enough frames ticking along waiting for it to appear? I'm with DZ-Jay here, if you try to display a pattern that points to GRAM but you didn't define anything, at best the memory contains random noise unless the CPU or setup code already cleared RAM before execution. Quote Link to comment Share on other sites More sharing options...
Coldheat Posted November 30, 2023 Share Posted November 30, 2023 1 hour ago, carlsson said: Yes, sprites won't appear until in the next frame but surely there would enough frames ticking along waiting for it to appear? I'm with DZ-Jay here, if you try to display a pattern that points to GRAM but you didn't define anything, at best the memory contains random noise unless the CPU or setup code already cleared RAM before execution. After more thought, I think this is more likely. I had my DEFINE statement not set correct before. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.