Jump to content
IGNORED

Beginner's question about sprites


Learn6502

Recommended Posts

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.

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...