Maze Game activate switches to open level exits.

User avatar
PewkoGames
Posts: 60
Joined: Thu Sep 13, 2018 9:16 am

Maze Game activate switches to open level exits.

Post by PewkoGames » Fri Jun 14, 2019 2:43 pm

So I'm working on a maze game, and the idea is the player has to avoid enemies while activating 4 switches on 4 corners of the screen. When you activate 4 switches the exit at the top of the level opens and you have to reach it to move on to the next level. My question is: How would you do that?

I also want there to be 1 power up/weapon that you can pick up and hold onto until you hit an enemy. Its like a one time invincibility that you have to save and use at the right moment. And when you kill whatever enemy they stay dead instead of the Pacman style temporary death.

If anyone could help out that would be great!
User avatar
dale_coop
Posts: 3617
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Maze Game activate switches to open level exits.

Post by dale_coop » Fri Jun 14, 2019 3:57 pm

You could use the key tiles / lecked door tile system? (or even with collectable tiles?)
When you got 4 you could open the door....
-----
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)
User avatar
PewkoGames
Posts: 60
Joined: Thu Sep 13, 2018 9:16 am

Re: Maze Game activate switches to open level exits.

Post by PewkoGames » Fri Jun 14, 2019 5:47 pm

I was thinking that, but A) What scripts do add to the Maze Game Module that get it to work (I assaigned GetKey and LockedDoor ASM to null tiles but I got unkown label errors)and B) How do I get it so by collecting 4 you open the exit? Just FYI I want it to be when you collect 4 it opens on its own and you have to avoid the monsters on your way back to the open exit.
User avatar
dale_coop
Posts: 3617
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Maze Game activate switches to open level exits.

Post by dale_coop » Fri Jun 14, 2019 7:23 pm

Yep, exactly, assign the KeyPickup script and the LockedDoor (from the "Basic\ModuleScripts\TileScripts\Adventure" folder foe example) to unused Tile Collision XX.
Then for the unknown label errors... it's because you need to add :
- a user constants "myKeys" (init value "0") in the "HUD & Boxes > Users Variables".
- a user constant "TILE_OPENDOOR" (value "0") in "Project Settings > User Constants".
- a SFX "SND_UNLOCK" in "Sound > SFX".

And for the check "4" collected... modify the "LockedDoor" script (or make a copy and use the copy), then replace the:

Code: Select all

	LDA myKeys
	BNE + ;; if you have no more keys.
With:

Code: Select all

	LDA myKeys
	CLC
	CMP #$04
	BCS + ;; if you have no more keys.
And the:

Code: Select all

	SubtractValue #$02, myKeys, #$01, #$00
With:

Code: Select all

	; SubtractValue #$02, myKeys, #$01, #$00
	LDA #$00
	STA myKeys	;; re-init the myKeys variable to 0
-----
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)
User avatar
PewkoGames
Posts: 60
Joined: Thu Sep 13, 2018 9:16 am

Re: Maze Game activate switches to open level exits.

Post by PewkoGames » Sat Jun 15, 2019 1:38 pm

Hey it worked! However, when I Open the door I can just walk to the next room. I want it when you touch/open the door, you play the victory animation and it warps you to the next level.
User avatar
dale_coop
Posts: 3617
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Maze Game activate switches to open level exits.

Post by dale_coop » Sat Jun 15, 2019 3:14 pm

No problem for that ;)
Modify your LockedDoor script, just after the Triggerscreen line, add that portion of code:

Code: Select all

	;; TriggerScreen screenType

	TXA
	STA tempx
	LDX player1_object
	LDA Object_x_hi,x
	STA temp
	LDA Object_y_hi,x
	STA temp1
	CreateObject temp, temp1, #OBJ_PLAYER_VICTORY, #$00, currentNametable
	LDX player1_object
	DeactivateCurrentObject
	LDA #$01
	STA loadObjectFlag
	StopSound
	LDA #$ff
	
	PlaySound #SND_VICTORY
	LDX tempx
-----
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)
User avatar
PewkoGames
Posts: 60
Joined: Thu Sep 13, 2018 9:16 am

Re: Maze Game activate switches to open level exits.

Post by PewkoGames » Sat Jun 15, 2019 3:32 pm

YAY! It works!

a few more questions:

If I want to make different collectables worth different amounts of points, Would I just copy the script for each collectable and alter the point values? or do I have to do it another way?

is it possible to have the point values appear when you collect each collectable? Like when you collect one and "200" appears for a second before dissapearing?

When I get invincibilty, is it possible to change the animation of the player? I want it to look like the player is stabbing a knife like Chucky the doll as she's invlnerable.

and finally is it possible for the monsters that get killed to stay dead? as opposed to just resetting?
User avatar
dale_coop
Posts: 3617
Joined: Fri Feb 16, 2018 7:05 am
Location: France

Re: Maze Game activate switches to open level exits.

Post by dale_coop » Sat Jun 15, 2019 4:32 pm

Yep to have different worth amounts you could copy the script... you might need to modify some labels (because you can't use the same label more than once in the project).
Another easy way... I don't see any.
Same for the "points" appearing when collecting. It could be objects, created by the collectable script. It's not very complicated, but If you know nothing about coding, maybe it would seem difficult for you.

For the invincibility... it's using an Action Step (I think it's the Action Step 3, if I remember well). So just use a custom Chucky-ish animation for that action step ;)
Sadly, your killed monsters can not stay dead.

You could trigger the screen, so when re-enter you will have no more monsters on screen. But how is working on your game right now? You can leave the screen and re-enter into it? (I thought it was a 1 screen maze with a warp to another screen on victory).
-----
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)
User avatar
PewkoGames
Posts: 60
Joined: Thu Sep 13, 2018 9:16 am

Re: Maze Game activate switches to open level exits.

Post by PewkoGames » Sat Jun 15, 2019 5:07 pm

Hey! so to answer your question its a 1 screen maze with a warp to another screen on victory. The monster death isn't that big an issue either. As far as the points appearing I may need help with that
Razzie.P
Posts: 29
Joined: Thu Jun 13, 2019 3:51 am

Re: Maze Game activate switches to open level exits.

Post by Razzie.P » Sat Jun 15, 2019 5:20 pm

PewkoGames wrote:
Sat Jun 15, 2019 3:32 pm

When I get invincibilty, is it possible to change the animation of the player? I want it to look like the player is stabbing a knife like Chucky the doll as she's invlnerable.

In your player object, you can click on "Manage animations," then click "add" to add whatever you'd like, such as "chuckstab_left, chuckstab_up, chuckstab_down" etc. Click "close," then you can simply add your animation tiles to the animation/frame by selecting via the dropdown. You'd have to create the actual graphics, of course, using the pixel editor or an external graphics program, but you probably knew that.
Post Reply