I have re-started my Mario game using the DPC+ kernel. This time I'm off to a great start and the code to dim my variables is a lot neater, cleaner, and easier to read than before.
Because of the limited amount of variables I used DEF a lot, but ran into the 50 DEF limit. So I've come up with a new way to set values, but I'm curious if there's an even better way.
First, a sample of how I was doing it:
def Make_Mario_Small=a{0}=0
def Make_Mario_Large=a{0}=1
def Mario_is_Small=!a{0}
rem ********************
def Make_Mario_Normal=a{1}=0
def Make_Mario_FirePowered=a{1}=1
def Mario_is_Normal=!a{1}
So, to make Mario large, all I'd have to type is Make_Mario_Large. To check Mario's size all I'd have to type is if Mario_is_Small then x else y.
How I'm redoing it is like this:
macro Poke
{1}={1}&{2}|{3}
end
def Setup=callmacro Poke
rem ********************
rem * Mario variables. *
rem ********************
dim Mario=a
rem ********************
const _Size=%11111110
const _Small=0
const _Large=1
rem ********************
const _Power=%11111101
const _None=0
const _Fire=2
So here, to make Mario large I go Setup Mario _Size _Large. To see if he's large I go if Mario&!_Size=_Large then x.
So, this works, but is there an even better way to do this?













