Language…
10 users online: 35TCB77,  BeeKaay, Cape, cozyduck, h.carrell,  KungFuFurby, PphoenixX, Samn, Smiddster3, Sokobansolver - Guests: 122 - Bots: 120
Users: 70,438 (2,474 active)
Latest user: Murder Luc

Password System

UberASM Repository → Password System

This file is obsolete. The latest version is Password System. For other versions, check the version history.

Submission Details

Name: Password System
Author: Nowieso
Added:
Version History: View
Type: Level
Includes GFX: No
Includes Hijack: No
Featured: No
Description: With this code, you can easily create a unique password system for your level. Set 1-10 inputs that have to be done in the correct order and one of these things will happen:

-Kill the player
-Hurt the player
-Give the player 1-UP(s)
-Give the player a Power-UP
-Give the player some coins
-Give the player Star-Power
-End the level (normal exit)
-End the level (secret exit), triggers the keyhole animation
-Spawn a sprite
-Change ON/OFF Switch state
-Activate P-Switch
-Teleport to current screen exit
-Teleport the player to the overworld, no event triggered
-Teleport the player to a different overworld position

Every option is very customizable, so make sure to change the defines in the asm file.
Tags: input lorom on off p-switch password sa-1 sprite spawn teleport
Comments: 2 (jump to comments)
Rating:
0.0 (0 ratings)
No rating
Download 4.11 KiB | 76 downloads

Screenshots

Comments (2)

simon.caio Link
Great! thank you!
 Kevin Link
Tested with: LM 3.04, UberASMTool 1.4, SA-1 1.32, Snes9x 1.6. The code works well and it has a lot of interesting options, so accepted.
I found a couple of small issues that would be nice to fix in an update: when enabling the PSwitch option, the song doesn't change. Also, for the silver PSwitch, you need to add a "JSL $02B9BD" to turn all the on-screen sprites to silver coins.

Besides that, it would be nice to make an update to optimize the code (it's not a major issue, but it could also be a useful exercise for you :P). Right now you've encoded the different inputs with separate defines, so there's no room for expansion and there's a lot of duplicate code to check all the different inputs. A much compact (and faster, probably) way to do this could be to encode the inputs in a table (that could be expanded beyond 10 entries), so you wouldn't need to check !freeRAM for each possible value and jump to the different (but basically identical) subsections: you could just use the same code, pulling the correct value from the table using !freeRAM as the index.