Oink 'n' Boink - 2 Player Battle Game

SciNEStist

Well-known member
Just X and Y values flying around the screen basically. Way less processing time when you aren't doing all the NES Maker object stuff

That is truly impressive. Can I ask you for some details on how you are handling the player collision with those X and Y coords?
 

JamesNES

Well-known member
That is truly impressive. Can I ask you for some details on how you are handling the player collision with those X and Y coords?
Thanks, it's like, find the bat's centre x/y point then see if it's inside the player's bounding box. So it's a point vs a box rather than two boxes intersecting.

Code:
checkPlayerCollisions:
    txa 
    pha 
    LDX #$00 


    LDA particleXHi,y
    STA tempA 
    

    LDA particleYHi,y 
    STA tempB
    
    LDA Object_x_hi,x 
    STA tempC 
    LDA Object_y_hi,x 
    STA tempD 

    ;;tempA = particleX
    ;;tempB = particleY
    ;;tempC = playerX
    ;;tempD = playerY
    
    ;;centre coordinates
    LDA tempA
    CLC
    ADC #$04
    STA tempA 
    LDA tempB
    CLC
    ADC #$04
    STA tempB

    
    LDA tempC
    CMP tempA ;;is px < x?
    BCC +
        JMP +noCollision
    +
    CLC
    ADC #$10
    CMP tempA ;;is px+16 > x?
    BCS +
        JMP +noCollision
    +
    ;;so x value is in range
    LDA tempD
    CMP tempB ;;is py < y?
    BCC +
        JMP +noCollision
    +
    CLC
    ADC #$10
    CMP tempB ;;is py+16 > y?
    BCS +
        JMP +noCollision
    +
    ;;has collided with player 
    GetActionStep tempG
    CMP #$07
    BNE +
        JMP +noCollision    
    +

    +deleteThisParticle
    jsr particle_bumpPlayer
    +noCollision
    

    pla
    tax

RTS

It was originally for things like bullets, hence "particle" all through it. I'm assuming the player's always 16x16 in this, and that the particle is always 8x8... which it's not now so I need to change that.
 

JamesNES

Well-known member
Wow... I'd love to have a small tutorial for your vertical scrolling. Looks very nice!

I think my brain almost broke figuring that one out, it's scaring me just trying to remember what I did! You draw in the next row of tiles when the scroll is a multiple of 8, and I'm using the sprite zero HUD to hide the draw-in. Making it autoscroll makes it a LOT easier when you're trying to learn too.

Took a couple of weeks off but I'm getting back into it now, going to spruce it up and make it more interesting.
 

JamesNES

Well-known member
THIS GAME IS FREAKING AMAZING!!!!!
Thanks!

Next mode I'm working on is a splitscreen button mashing race type thing. Got the basics working so far, going to put in obstacles and carrots to collect which determines the winner. You'll get power ups to attack the other person and put them off too. You alternate right on the D pad and the B button to run faster.

marathon.gif
 

JamesNES

Well-known member
Haha thanks, I've compartmentalized it to the point I can make a bunch of independent little games, trying out different things. I want to have ten different games that get randomly switched between
 

Woogz

Member
This is so cool, I haven't seen this before. :love: You've gotta make some tutorials for the menus and text scrolling in the first post, that's so clean. Keep up the fantastic work.
 

JamesNES

Well-known member
This is so cool, I haven't seen this before. :love: You've gotta make some tutorials for the menus and text scrolling in the first post, that's so clean. Keep up the fantastic work.

If there's something specific you want to ask just hit me up in the PMs, this sort of thing gets very project specific. Like, I was just typing text out on a fairly plain screen so I didn't have to worry about changing/restoring attributes and that sort of thing.

Making progress on my splitscreen running minigame, it's an actual game with obstacles and collectibles now. Gotta work on the spawning algorithm cos it can be a bit brutal but I'm really happy so far. It's even got a speedometer in the corner haha. Not sure whether to cap the max speed or not yet, it can get pretty insane.

marathon2.gif
 

JamesNES

Well-known member
Was wanting a break from making gameplay stuff so I thought I'd re-do the round over screen. This one is a lot quicker, the other one was pretty drawn out and unnecessary.

I didn't know enough about updating nametables/VRAM when I made the first demo so I literally couldn't have done this then. Means I'm learning stuff!

I also like the bouncing text, looks neat.

roundover.gif
 

SciNEStist

Well-known member
This is shaping up to be the most technically impressive game! I hope you release physical copies when it's all done.
 
Last edited:

JamesNES

Well-known member
This is shaping up to be the most technically impressive game! I hope you release physical copies when it's all done.

Thanks! Long way off thinking about that sort of thing though. It's open enough I can just keep adding things forever...

My big breakthrough this week was adding a "Round Start" sort of splash screen, which meant restoring tiles and attributes from the original nametable, something I hadn't done before. Was initially a bit of a brain strain but I figured it out in the end and it looks awesome! I ejected the standard NES Maker textbox stuff when I started as making changes to it was really confusing so I had to write this myself.

I showed my partner and she's like "so everyone round's going to have differently animated text? That's cool!" and now I feel obligated to do it. Rough!

roundstart.gif
 

SciNEStist

Well-known member
I bet you freed up a ton of space by wiping out the textbox code. That nametable stuff is some very complicated code to get into for me. I was trying to figure out a way of pulling the tile # and pallette for particular x/ y coords and had to backburner it so my brain didn't melt. Are you just restoring the covered up bits, or the entire screen?
 
Last edited:

JamesNES

Well-known member
I bet you freed up a ton of space by wiping out the textbox code. That nametable stuff is some very complicated code to get into for me. I was trying to figure out a way of pulling the tile # and pallette for particular x/ y coords and had to backburner it so my brain didn't melt. Are you just restoring the covered up bits, or the entire screen?

It's just drawing over the parts the need to be, otherwise it'd take too long or I'd have to turn off the screen.

The process goes like:

-switch to bank 16 and get the nametable address lo and hi like this:

Code:
    SwitchBank #$16
        LDA camScreen 
        TAY 
        LDA NameTablePointers_Map1_lo,y 
        STA temp16
        LDA NameTablePointers_Map1_hi,y 
        STA temp16+1
    ReturnBank

(I'm not using the underworld so it's always map 1 for me)

-then switch to the screen bank for this screen and you can load and draw the meta tiles one by one

Code:
;;find  and switch to the screen bank
	LDA camScreen 
	LSR 
	LSR 
	LSR 
	LSR 
	LSR 
	STA temp1 
        SwitchBank temp1

	;;load a tile from the original nametable pattern
	;; y is the coordinates of the metatile to load like #$YX
	LDA (temp16),y
	
	STA tempA 
	
	;;now you can use a macro or subroutine to load it into the update ram to be drawn

Hope that helps. Attributes is basically the same thing but the tables are smaller since there are less attributes per screen.
 
Last edited:

JamesNES

Well-known member
Making more progress on the running game, there are water traps that spawn in now. And birds, and varying heights of fences to jump.

hurdles.gif
 

JamesNES

Well-known member
I’m constantly amazed by your coding skills. This game looks like so much fun!
That's very nice of you! I haven't had a go at it actually playing with another person since I broke half of it when I started overhauling it and adding new modes, so hopefully it will be fun when I try it properly.

I went and fully fleshed out my bat dodging game, adding support for the second player and mixing up the bats' movement somewhat. I was worried adding player 2 and their collisions in would slow things down but it's still blazing fast. There's a chance when they touch the edge they'll either bounce or fly away and a new one spawns in. Ended up capping it at 11 bats so I can save at least some RAM for other things.



bdodge.gif
 

SciNEStist

Well-known member
Having another person to test with makes all the difference.
Every time I have another person test with me, I find a new bug I need to fix that would never show up unless there were 2 people playing at once.
It also allows you to adjust gameplay elements that don't balance out right or end up working as expected
 
Top Bottom