Ok then, thanks for the clarification. Lets see if that fixes it.
When you get to the actual game, specifically the bit with the money moving and all, you'll want to take advantage of double buffering; for now, though, you should be fine just staying on one side of the LCD. To do this, you can use the real(8,1 command to set the side of the LCD being drawn to; if you set it to the side you're currently looking at, you won't have to worry about setting the UpdateLCD argument to 1.
There we go! Fixed it all up, and I have multiple walriis on screen! Now to code erasing, and throwing the coin!
Bump!

So, I got sprite erasing down, there's just a little flickering, and the rectangles I used to erase aren't tall enough. Easy enough to fix! Except the flickering, how would that be fixed? Any help there? Would I have to switch sides of the screen or something?

I haven't gotten around to drawing the player, so that's gonna happening tomorrow. If you don't' know yet, the player will be a purple mouse cursor. Wink

Anyways, screenshot!


EDIT: I fixed up the display issues with the sprites,there's just flickering to think about. Should I get rid of it though? It kind of gives the illusion of flying/flapping.
Bump

Welp, I have the updated screenshot, but I kind of lost inspiration for today, making the walriis populate the screen much less. So, I'm gonna add the cursor to the spritesheet and code movement.

Then we'll see how I can do this.


EDIT: Updated Spritesheet! There's gonna be a little surprise in there...



EDIT 2: Welp, there's a problem. How am I going to erase the player sprite? The background is, well, very colorful. I can't use real(7,9 either. What should I do? Create a sprite that uses the same patter as the background to erase the player sprite.

EDIT 3: DJ informed me of real(5,3 so that problem is solved. Also, its seems like I am doing something wrong with the pic index.


Code:

real(4,0,P,0,2,2,0,0,4,0,1,3,4,11,12

Does not display the cursor right. So what am I doing wrong? It seems to be 3,4,11,12.

Thats about it for today!
Well, the pic index start should be 0, not 1. And I'm not sure where you got 3,4,11,12 from-- it would be 32,33,40,41 because the spritemaps are sorted column-first.
oops, I didn't update the spritesheet image. Here it is:



This is what happens to the sprite. Ignore the bottom 3 copies


EDIT: I fixed everything, per Wrights suggestion, I changed the StartPicIndex to 0 from 1. So yeah, now its time for redrawing the background after the player moves.
bump.

So I am needing help! I am using a VERY crude way to display and erase the walruses. I think it needs to be totally rewritten. I want it to display the walruses for 3-5 seconds each, and then erase. So any suggestions on how to optimize and change the code?


Code:

ClrHome
real(0,1,1
real(8,1,0
"MNYWBG
real(5,2,0
"MNSPRT
real(5,0,0
DelVar NDelVar BDelVar K
Repeat K=45
getKey→K
randInt(1,5→A
If randInt(1,100=2:Then
real(7,9,123,0,29,26,93,0
real(4,0,125+A-2,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
N+1→N
End
If randInt(1,100=3:Then
real(7,9,30,0,28,26,93,0
real(4,0,35-A,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
N+1→N
End
If randInt(1,100=5:Then
real(7,9,58,0,30,26,93,0
real(4,0,58+A,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
N+1→N
End
If randInt(1,100=4:Then
real(7,9,91,0,31,26,93,0
real(4,0,97-A,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
N+1→N
End
If randInt(1,20=7:Then
real(7,9,1,0,29,26,93,0
real(4,0,1+A,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
N+1→N
End
If K=24
P-16→P
If K=26
P+16→P
If K=24 or K=26:Then
"MNYWBG
real(5,1,0
real(5,3,P-16,104,16,16,0,0
real(5,3,P+16,104,16,16,0,0
End
real(4,0,P,104,2,2,0,0,4,0,0,3,4,11,12
End


And I can't figure out how to use the draw background command, hence the blue after the mouse cursor.



Well thats weird. The blue doesn't show up after the mouse cursor, but it does that on my calc, and I think the versions are the same.

Thanks in advance!
How is the game suppose to work? Are five walrus shown at one time or just one moving around?
You are supposed to throw money at walruses, but the walruses are not really displaying how they will. They will display at random for 5 seconds, then disappear.
How many walruses will be on the screen at once?
5, of course Wink
Update your version of Doors to fix the background problem. Use the buffer to eliminate flicker by drawing the background on both sides. For the cursor, use another variable to hold the old sprite location. Draw the cursor (switching the buffer) then delete the cursor at the old location regardless of a button press or not.
Ah, I have forgot to update Doors on my calc, but it is updated on wabbit. :\

Also, there won't be that much flicker, as the sprites will only be erased every few seconds, rather than milliseconds Wink

So the above screenshot isn't that accurate, and I should have a good one tomorrow.
Bump



Code:

ClrHome
real(0,1,1
real(8,1,0
"MNYWBG
real(5,2,0
"MNSPRT
real(5,0,0
DelVar NDelVar BDelVar K
Repeat K=45
getKey→K
If T≤10:Then
randInt(1,100→M
real(7,9,M,1,0,29,26,93,0
real(4,0,1,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
End
T+1→T
If T≥10:Then
DelVar T
real(7,9,M,1,0,29,26,93,0
End
If K=24
P-16→P
If K=26
P+16→P
If K=24 or K=26:Then
"MNYWBG
real(5,1,0
real(5,3,P-16,104,16,16,0,0
real(5,3,P+16,104,16,16,0,0
End
real(4,0,P,104,2,2,0,0,4,0,0,3,4,11,12
End


So now There are random blue lines everywhere and walrii only displays once. Shock

Any suggestions for that? I haven't had much time to look at it, so please bear with me if its a silly mistake.
bump, again

Just recently resent everything to my calc, without changing a thing, and there seems to be corruption. When displaying the sprites, the Walrus becomes white, and the mouse becomes green. I remade the spritesheets, but it still occurs, That led me to the conclusion that my code was the problem. But, I didn't change a think to do with displaying sprites! Any help here?



Code:

ClrHome
real(0,1,1
real(8,1,0
"MNYWBG
real(5,2,0
"MNSPRT
real(5,0,0
DelVar NDelVar BDelVar K
19→T
Repeat K=15
real(2,0,0
Ans→K
T+1→T
If T=20:Then
randInt(1,130→M
real(4,0,M,1,3,3,0,0,4,0,0,0,1,2,8,9,10,16,17,18
End
If T≥40 or U≥40 or V≥40:Then
DelVar TDelVar UDelVar V
real(7,9,M,1,29,26,93,0
real(7,9,M,1,29,26,93,0
real(7,9,M,1,29,26,93,0
End
If K=2
P-16→P
If K=3
P+16→P
If K=2 or K=3:Then
"MNYWBG
real(5,1,0
real(5,3,P-16,104,16,16,0,0
real(5,3,P+16,104,16,16,0,0
End
real(4,0,P,104,2,2,0,0,4,0,0,3,4,11,12
End


File: zip
It sounds like you set up a color offset with real(0,3,5) somewhere, but I don't see that in your code. Can you explicitly set a color offset of 0 at the beginning just to make sure that's not related?
It's not just you; write real(0,3,5,0) at the beginning of your program to fix it. I think Doors messes it up, since it happens to me even right after a RAM clear.
M. I. Wright wrote:
It's not just you; write real(0,3,5,0) at the beginning of your program to fix it. I think Doors messes it up, since it happens to me even right after a RAM clear.
I believe my post above suggested the same idea. Smile However, if this is a persistent problem, tr1p1ea and I need to deal with it. Thanks for the confirmation that this may be an outstanding bug we need to fix.
Welp, that fixed it Smile
Now, I think I'm gonna have troubles with sprite collision.

Count, I know understand.

How would I check if sprite at A,B with a W/H of 16 meets another at D,C with a W/H of 16?

real(4,6,1,A,B,16,16,C,D,16,16 is what I get. Is that correct? If they do collide, they would return 1 to ans right? To check multiple sprites at once, would I need multiple real(4,6 commands?
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 3
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement