danmaku.nes: 100 Bullet Demo

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
User avatar
pubby
Posts: 587
Joined: Thu Mar 31, 2016 11:15 am

danmaku.nes: 100 Bullet Demo

Post by pubby »

Here's a little demo I made this morning. It displays up to 100 bullets on the screen at once using the backround layer to prevent flicker.

Hold the A button to spawn bullets. Hold the B button to destroy bullets.

Image
Attachments
danmaku.nes
(24.02 KiB) Downloaded 303 times
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: danmaku.nes: 100 Bullet Demo

Post by Myask »

I'd been thinking: from there, when you add a player character, you can have it collide with those with less than ten cycles (check sprite-0 hit per-frame). And you can have the collision be pixel-perfect, not shaped like the displayed character, however you like.
User avatar
tokumaru
Posts: 12437
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: danmaku.nes: 100 Bullet Demo

Post by tokumaru »

As long as the collision mask is 8x16 pixels or smaller...
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: danmaku.nes: 100 Bullet Demo

Post by Myask »

True. It's not uncommon for it to just be one pixel, though.
User avatar
tokumaru
Posts: 12437
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: danmaku.nes: 100 Bullet Demo

Post by tokumaru »

Myask wrote:True. It's not uncommon for it to just be one pixel, though.
But aren't we talking about the player's collision mask here? The bullets are in the background, and there are many of them. If you're gonna use sprite 0 hits for this, sprite 0 will have to represent the player, which is often larger than 8x16, unless it's a lemming!
User avatar
Myask
Posts: 965
Joined: Sat Jul 12, 2014 3:04 pm

Re: danmaku.nes: 100 Bullet Demo

Post by Myask »

Ah. Yes, if the collision is "being pixel-perfect", the sprite has to be 8x16 or smaller. I think I didn't clearly distinguish between my options there.

It's not uncommon in danmaku games for the player-sprite to be much larger than its hitbox, and the hitbox to be only a single pixel (or 3x3, or similarly tiny). This is unlike Gradius and "classic" shmups where the entire ship can take damage.
User avatar
pubby
Posts: 587
Joined: Thu Mar 31, 2016 11:15 am

Re: danmaku.nes: 100 Bullet Demo

Post by pubby »

The nametables get updated at 15 FPS so you would have time to do four sprite-0 checks. This means that the collision rectangle could be 16x32.

However, the bullets are actually moving at 30 FPS because the game uses palette switching to double the framerate. This has two downsides: 1) the bullets have to be a single color. 2) sprite-0 hits could happen a frame before the bullets actually collide.
Post Reply