Page 18 of 109

Posted: Sat Aug 27, 2011 4:26 pm
by 3gengames
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.

Posted: Sat Aug 27, 2011 4:52 pm
by unregistered
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?

Posted: Sat Aug 27, 2011 4:53 pm
by 3gengames
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. :)

Posted: Sat Aug 27, 2011 5:06 pm
by unregistered
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! :)

Posted: Sat Aug 27, 2011 5:18 pm
by 3gengames
Okay, as long as you don't need to scroll to the right of the 2nd nametable, it should be fine then. :)

Posted: Sat Aug 27, 2011 6:18 pm
by unregistered
Ah ha! Ok, thanks 3gengames! :D

Posted: Sat Aug 27, 2011 6:20 pm
by 3gengames
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.

Posted: Sun Aug 28, 2011 3:14 pm
by unregistered
3gengames, thank you. :)
---

For sbc,

Code: Select all

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?

Posted: Sun Aug 28, 2011 3:27 pm
by 3gengames
Set subtract. Clear Add.

Posted: Sun Aug 28, 2011 3:30 pm
by unregistered
3gengames wrote:Set subtract. Clear Add.
Rock (yes)! :D Thanks!

Posted: Sun Aug 28, 2011 5:12 pm
by unregistered
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. :?

Posted: Sun Aug 28, 2011 5:31 pm
by tepples
Make a game object called the "camera" and fix the scroll position relative to it.

Posted: Mon Aug 29, 2011 12:59 pm
by unregistered
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. :)

Posted: Mon Aug 29, 2011 1:30 pm
by tokumaru
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.

Posted: Mon Aug 29, 2011 2:28 pm
by unregistered
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