nesdev.com
https://forums.nesdev.com/

8x16 and whatever else unreg wants to know
https://forums.nesdev.com/viewtopic.php?f=10&t=7451
Page 18 of 97

Author:  3gengames [ Sat Aug 27, 2011 4:26 pm ]
Post subject: 

When you're "camera" moves the screen, once you hit the nametable, how will you scroll to the right more? To do that, you must set the main nametable to be the one you're scrolled onto all the way, because to scroll across it more, it has to be the main table since you can't scroll anymore if you set the scroll to the max.

Author:  unregistered [ Sat Aug 27, 2011 4:52 pm ]
Post subject: 

Image
In my head the top left of the screen/camera can make it to 255. Then wouldn't almost all of NameTable 1 be shown?

Author:  3gengames [ Sat Aug 27, 2011 4:53 pm ]
Post subject: 

Then how do you scroll to the right of that nametable? By setting it as the main one, resetting your scroll, and then scrolling right again. I wish I could make gif's, as it'd be way easier to show than tell. :)

Author:  unregistered [ Sat Aug 27, 2011 5:06 pm ]
Post subject: 

3gengames wrote:
Then how do you scroll to the right of that nametable?

I dont want to scroll to the right of NameTable 1 right now.

3gengames wrote:
I wish I could make gif's, as it'd be way easier to show than tell. :)

oooh well I just used bunnyboy's graphic from this page. Just copied it over from there to my web account server... You can make gif's. Try the gimp! :)

Author:  3gengames [ Sat Aug 27, 2011 5:18 pm ]
Post subject: 

Okay, as long as you don't need to scroll to the right of the 2nd nametable, it should be fine then. :)

Author:  unregistered [ Sat Aug 27, 2011 6:18 pm ]
Post subject: 

Ah ha! Ok, thanks 3gengames! :D

Author:  3gengames [ Sat Aug 27, 2011 6:20 pm ]
Post subject: 

unregistered wrote:
Ah ha! Ok, thanks 3gengames! :D


Yep, and I have failed at making that GIF, heh. And same goes for the bottom, as long as you don't need to scroll past there, you're fine. :) Good luck.

Author:  unregistered [ Sun Aug 28, 2011 3:14 pm ]
Post subject: 

3gengames, thank you. :)
---

For sbc,
Code:
Operation: A - M - -C -> A
Note: -C = Borrow


I have clc right before sbc... but since -C is the Borrow it seems, to me, that it is really ¬C. So my idea is to sec instead. (I'm trying to clear the borrow.) What do yall think?

Author:  3gengames [ Sun Aug 28, 2011 3:27 pm ]
Post subject: 

Set subtract. Clear Add.

Author:  unregistered [ Sun Aug 28, 2011 3:30 pm ]
Post subject: 

3gengames wrote:
Set subtract. Clear Add.

Rock (yes)! :D Thanks!

Author:  unregistered [ Sun Aug 28, 2011 5:12 pm ]
Post subject: 

Praise God!! :D The screen scrolls right when our lady travels right close to the edge of the screen!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Thank you so much tepples and 3gengames and tokumaru and booker and Kasumi and Bregalad and Shiru! :D

I also have a question to ask: How do I make it so that the screen scrollls over the same speed as our lady travels? Right now she reaches the right side of the screen before she makes it to the end of NameTable 1. :?

Author:  tepples [ Sun Aug 28, 2011 5:31 pm ]
Post subject: 

Make a game object called the "camera" and fix the scroll position relative to it.

Author:  unregistered [ Mon Aug 29, 2011 12:59 pm ]
Post subject: 

tepples wrote:
Make a game object called the "camera" and fix the scroll position relative to it.


Ok I created a byte called "Camera". Now there's 2 variables that are similar to Camera: oX and scroll. I should move both the screen and the character by Camera, right? Should Camera be 16bits so it can keep track of what nametable it is on? Here is good camera discussion. :)

Author:  tokumaru [ Mon Aug 29, 2011 1:30 pm ]
Post subject: 

Your camera coordinates should be 16-bit. /since your game only scrolls horizontally, you only need a "CameraX" variable, because "CameraY" would always be 0.

You should make the camera follow the player using whatever logic you see fit. Some games move the camera by the same amount as the player every frame, others move it only if the player has gone past a certain point. No matter what rules you use, the camera must always follow the player.

The coordinates of the camera can be directly used to set the scroll, you don't need more variables for that. Another important thing is that the coordinates of the sprites must be calculated by subtracting the coordinates of the objects by the coordinates of the camera. With scrolling, object coordinates can no longer be used directly as sprite coordinates, because they are relative to the level and not the screen. That subtraction does the convertion from level coordinates to screen coordinates.

Author:  unregistered [ Mon Aug 29, 2011 2:28 pm ]
Post subject: 

tokumaru wrote:
Your camera coordinates should be 16-bit. /since your game only scrolls horizontally, you only need a "CameraX" variable, because "CameraY" would always be 0.

You should make the camera follow the player using whatever logic you see fit. Some games move the camera by the same amount as the player every frame, others move it only if the player has gone past a certain point. No matter what rules you use, the camera must always follow the player.

The coordinates of the camera can be directly used to set the scroll, you don't need more variables for that. Another important thing is that the coordinates of the sprites must be calculated by subtracting the coordinates of the objects by the coordinates of the camera. With scrolling, object coordinates can no longer be used directly as sprite coordinates, because they are relative to the level and not the screen. That subtraction does the convertion from level coordinates to screen coordinates.


tokumaru, thank you! :D

Page 18 of 97 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/