Turning off projectile power-up (2-player platform module)

Post Reply
vanderblade
Posts: 94
Joined: Mon Jan 07, 2019 5:20 am

Turning off projectile power-up (2-player platform module)

Post by vanderblade » Tue Feb 11, 2020 1:35 am

I'm implementing power-ups and pickups in my Bubble Bobble-esque game as part of my finishing touches.

So far I have the obvious health pickup, which works fine.

I also have the projectile power-up operating.

However, I want the player to lose the projectile power-up when they finish the single-screen stage and start another. This way, they will only have the projectile on the screen where they pick up the power-up.

I've searched the forums for turning the projectile off, but so far have found nothing.

What's the easiest way to accomplish this? Can we add a line or two to the Level Win script (Collectable_DC.asm) to deactivate the projectile?
User avatar
dale_coop
Posts: 4868
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Turning off projectile power-up (2-player platform module)

Post by dale_coop » Wed Feb 12, 2020 4:56 pm

Yeah, great idea. You can implement that, here's the code to remove the projectile ability:

Code: Select all

    ;; removes the Projectiles ability:
    LDA weaponsUnlocked
    AND #%11111101
    STA weaponsUnlocked
Two possibilities:
- you could add a piece of code in the Collectable_DC.asm script (just before the "JSR HandleNoMorePrizeTiles" line).
- or, you could add the piece of code directly at the end of the script assigned to the "Handle No More Prize Tiles" (from the Project Settings > Script Settings).

Both should work.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
vanderblade
Posts: 94
Joined: Mon Jan 07, 2019 5:20 am

Re: Turning off projectile power-up (2-player platform module)

Post by vanderblade » Wed Feb 12, 2020 10:19 pm

Awesome! Thanks, Dale. I will try it tonight; otherwise, I'm out of town for several days and will try when I return.
vanderblade
Posts: 94
Joined: Mon Jan 07, 2019 5:20 am

Re: Turning off projectile power-up (2-player platform module)

Post by vanderblade » Thu Feb 13, 2020 4:18 am

I just tested it and it works great. I wonder if we can't mess with the randomizer to make this powerup appear less often. I want it to feel a little more special when it appears. I don't care about this with my other drops so much.

I imagine we have to mess with this element of the handledrops code.

Code: Select all

JSR GetRandomNumber
	AND #%00000111 ;; now, we have a number between 0 and 7
	BNE notPickup0 ;; 
	;; zero case here;
	LDA #OBJ_MONSTER_DROP_ITEM1
	BEQ notPickup0
	;;; here, we'll create health
	CreateObject temp, temp1, #OBJ_MONSTER_DROP_ITEM1, #$00, currentNametable
	JMP donePickup
notPickup0:
	CMP #$01
	BNE notPickup1
	;; one case here;
	LDA #OBJ_MONSTER_DROP_ITEM2
	BEQ notPickup1
;;; here, we'll create projectile powerup
	CreateObject temp, temp1, #OBJ_MONSTER_DROP_ITEM2, #$00, currentNametable
	JMP donePickup
notPickup1:
	CMP #$02
	BNE notPickup2
	;; two case here;
	LDA #OBJ_MONSTER_DROP_ITEM3
	BEQ notPickup2
	;;; here, we'll create score drop
	CreateObject temp, temp1, #OBJ_MONSTER_DROP_ITEM3, #$00, currentNametable
	JMP donePickup
notPickup2:
	;;;; do the same for each case.
	;;;; blank cases will simply return 'nothing'.
For Pickup1 specifically (the projectile), how do we make it so the drop is more rare, that it happens less frequently?
vanderblade
Posts: 94
Joined: Mon Jan 07, 2019 5:20 am

Re: Turning off projectile power-up (2-player platform module)

Post by vanderblade » Tue Feb 18, 2020 11:17 pm

bump
Last edited by vanderblade on Sun Feb 23, 2020 8:37 pm, edited 1 time in total.
User avatar
dale_coop
Posts: 4868
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Turning off projectile power-up (2-player platform module)

Post by dale_coop » Sun Feb 23, 2020 3:08 pm

I guess you could modify that behavior...
something you could try, adding this code

Code: Select all

	JSR GetRandomNumber
	AND #%00000011 ;; now, we have a number between 0 and 3
	BNE donePickup
Just before your :

Code: Select all

;;; here, we'll create projectile powerup
	CreateObject temp, temp1, #OBJ_MONSTER_DROP_ITEM2, #$00, currentNametable
It would add another random factor (0-3), to make it less regular.
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
vanderblade
Posts: 94
Joined: Mon Jan 07, 2019 5:20 am

Re: Turning off projectile power-up (2-player platform module)

Post by vanderblade » Mon Feb 24, 2020 5:50 pm

Thanks, Dale! It works maybe too good. I played over 30 levels of the game and never had it drop. But that's maybe how it should be since the game was not designed with the projectile in mind. I'll test a bunch more.
User avatar
dale_coop
Posts: 4868
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Turning off projectile power-up (2-player platform module)

Post by dale_coop » Tue Feb 25, 2020 12:48 pm

LOL
You could reduce the random factor...

Code: Select all

	JSR GetRandomNumber
	AND #%00000001 ;; now, we have a number between 0 or 1
	BNE donePickup
-----
Sorry about my poor english
All I need: A Damn Fine Cup of Coffee
My games: PRESS START GAME / UNDERGROUND ADVENTURE / UNDERGROUND ADVENTURE (Arcade version - Byte-Off-2019)
Post Reply