Still lurking in the shadows of nesdev

Are you new to 6502, NES, or even programming in general? Post any of your questions here. Remember - the only dumb question is the question that remains unasked.

Moderator: Moderators

Post Reply
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

Still lurking in the shadows of nesdev

Post by log in »

Hi there,

Im still around,and did a lot of work.

First off. I want to thanks everybody that helped me here with my questions.
Thanks to your help i understand quit a few thinks now.

I can make 1 sprite on screen/ multiples
give the sprite some controlls up down etc.
and make a background(a simple 1)

programming that 8bit beast of power and the bunnyboy lessons helped me out too.

And for the rest i did a lot of fooling around with asm and chr code.

Incredible i made it this far.
Now i want to try to make my dream come true!

programming/making my own nes game
NO HACKING! but programming it myself and making the graphics myself.
That would be great.

I dont care if its something simple like pong or dodging things.
But i think a 1 screen game is the best for me :wink:

SO.. MY QUESTION IS.. What game should be great to make for me as a first game ??
pong?


AND: i can make a background and sprites moving but thats where most lessons stop.

Where can i find documents info that takes me from there?
I MEAN... lets take this exsample

the game ....munchie attack (nice 1 screen game)

i could make this backgound and the sprites,hell i could even make the main character move!
BUT i have no idea how to programm all things that are coming at him and the HITS how do you programm that?
im a newbie,lets see how far i can get
User avatar
tokumaru
Posts: 12106
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Post by tokumaru »

I see what you mean. Most tutorials cover the basics of interacting with the NES, but that has very little to do with how a game works, and it's not that easy to find good information about that.

Just think of a game as collection of objects that interact, and have the program process each object every frame. Say, if you decide to code pong, you have 3 main objects: the 2 paddles and the ball. Of course, there are other supporting procedures that must be performed before and/or after processing the objects, such as reading the controllers (the objects will use this information later), clearing the OAM mirror (so that the objects can output their sprites), and so on. For a simple pong game, the main loop could be as simple as:

Code: Select all

Game:
	jsr ReadControllers
	jsr ClearOAM
	jsr ProcessPaddle1
	jsr ProcessPaddle2
	jsr ProcessBall

	jsr WaitNMI
	jmp Game
The NMI routine will perform a sprite DMA and possibly call the music routine. The routines that handle the paddles simply check what buttons are pressed and move up or down accordingly. They also output the sprites for the paddles, in the correct positions, to the OAM mirror. The ball objetct must have attributes such as X velocity and Y velocity, so that it's coordinates are updated with these values every frame. It must check for collisions with both paddles (you can compare the X coordinates for that) and invert the X velocity in case of impacts.

This is basically it. Probably all games can be programmed like this, in terms of objects that are processed little by little every frame, with supporting functions surrounding them. What makes a game more complex is the amount of features you want. For example, if you decide to scroll, that means you'll have to redraw your background, and you'll probably need a camera object and many functions to decode tile data and attribute data, as well as buffers to hold that data. Another thing that makes pong simpler than other games is that it has only 3 objects through the whole game, while more complex games may have a dynamic list of active objects that is updated as the player walks. Still, the basic setup for a game is what I showed you above.

Let us know if you have any more questions, OK?
User avatar
log in
Posts: 72
Joined: Tue Jun 24, 2008 1:06 pm
Location: neverland

Post by log in »

well,i decided to go for pong.

I made some graphics (paddle's and ball)
and made the asmcode.

What do i have now :?:

A nice .nes file that show 2 paddle's that i can move up and down and a lazy ball in the center that doesn't move a inch :D

looked at nesdev and googled but could't find much info :cry:

I did look at a asm file of another pong game and i think i need to ad this...

Variables (gamestate.1 ?? ) here goes ball info

Constats (walls and paddle's)

Ball stats (left up etc

And engine playing (hugh list of directions for paddle's and ball)

Are this the things all needed to move the ball and bounch it of walls and paddle's?

Im really frustrated that i cant work further because of lack of information.
So please nesdev pimp my code.

I mean can somebody give me a push in the right direction :D at least i didn't loose my humor
im a newbie,lets see how far i can get
Post Reply