'Zelda Clone take 2
Control_Pad
AS _BYTE 'which Gamepad\Joystick Device Is player Using? BAD_Pad
AS _BYTE 'option for Buttons As Directions Joy_Up_Val
AS _BYTE 'axis value for up Joy_Down_Val
AS _BYTE 'axis value for down Joy_Left_Val
AS _BYTE 'axis value for left Joy_Right_Val
AS _BYTE 'axis value for right Joy_Button_Up
AS _BYTE 'for people whos controllers give BUTTON states for direction keys Joy_Button_Down
AS _BYTE 'or just want to use buttons for the direction keys. Joy_Button_Right
AS _BYTE 'however this fails to work so may not be implemented.
Projectile_Count
AS _BYTE 'Number of projectiles (including bombs) on screen LoadedGame
AS _BYTE ' which game is loaded?(1-3) MSTR_Vol
AS _BYTE ' Master Volume level SFX_Vol
AS _BYTE ' Sound FX Volume level BGM_vol
AS _BYTE ' Music Volume level ControlType
AS _BYTE ' player using Keyboard or Joypad? Device_Count
AS _BYTE 'Total input Devices aviliable ItemCount
AS _BYTE ' Number of items on screen Collected
AS _BYTE ' item link just picked up
Id
AS _BYTE ' Kind of projectile; Sword\Arrow\Rock\Ball Direction
AS _BYTE 'Direction Projectile is traveling Hits
AS _BYTE ' Hits per projectile\(AKA:damage) in half heart increments Owner
AS _BYTE ' Who shot the projectile
'-----Position data-----
World
AS _BYTE ' Player in Overworld or Underworld World_X
AS _BYTE ' Overworld X position World_Y
AS _BYTE ' Overworld Y position Tile_Y
AS _BYTE ' Array Y location:for Collision\entrances Direction
AS _BYTE ' Direction player is moving\facing '-----------------------
'------Status Data------
Hearts
AS _BYTE ' Units of health: 2 units(halves) per heart Containers
AS _BYTE 'Max number of health: total full hearts Hits
AS _BYTE ' Used when Link has defence rings;Blue = 2 hits per 1\2 heart, Red = 4 hits per 1\2 heart Max_Bombs
AS _BYTE ' how many bombs can Link carry '-----------------------
'------Items Data-------
Sword
AS _BYTE ' Which Sword does player have? Wooden-1,Silver-2,Magical-3 Weapon
AS _BYTE ' Which Weapon is in hand A? Wooden-1,Silver-2,Magical-3,Wand-4 Ring
AS _BYTE ' Which does player have? 0-none, 1-blue,2-red Has_Candle
AS _BYTE ' 1-Blue, 2-Red Has_Letter
AS _BYTE ' 1-letter, 2-Blue Potion, 3-Red Potion Has_Shield
AS _BYTE ' Player has Magic Shield TriForce
AS _BYTE ' each bit represents a collected piece Has_Map
AS INTEGER ' each bit represents a dungeon map Has_Compass
AS INTEGER ' each bit represents a dungeon compass '-----------------------
'------Extra Data-------
Action
AS _BYTE ' is player; using an item, Aquiring an item\sword, or aquiring a piece of the triforce? Shot
AS _BYTE ' player has shot sword Beaten
AS _BYTE ' Has player beaten Game 1? Game 2? Shown_Letter
AS _BYTE ' Has player shown Old woman the letter? '-----------------------
Hidden
AS _BYTE ' is there something under the tile? Burnable
AS _BYTE ' can the tile be burnt with candle? Pushable
AS _BYTE ' can the tile be moved by pushing? Bombable
AS _BYTE ' can the tile be blown up with bomb? PushableXtra
AS _BYTE ' can the tile be moved by pushing with braclet? Is_Shop
AS _BYTE ' is there a shop here?(shop\gift\gamble) Is_Secret
AS _BYTE ' secrets under bushes dont walk in, just jump in. Is_Dungeon
AS _BYTE ' is this a dungeon entrace? contains which one Walkable
AS _BYTE ' can the tile be walk upon? Can_Awaken
AS _BYTE ' touching the tile awakens the monster (graves and statues) Is_Open
AS _BYTE ' the player has blown up\burnt\pushed the tile out of the way Candle_Used
AS _BYTE ' the player used the candle Movement_Special
AS _BYTE ' can the player move freely?
Xloc
AS INTEGER ' X location of the item\collision box Yloc
AS INTEGER ' Y location of the item\collision box Xsiz
AS _BYTE ' Xsize of the collision box Ysiz
AS _BYTE ' Ysize of the collision box Is_Special
AS _BYTE ' Is this a special pickup? pauses game while Link lifts the item Death
AS INTEGER ' items vanish after 90sec(by game count not timer) except for Special items
Sprite_X
AS INTEGER 'Items sprite sheet location BoxSize_X
AS _BYTE 'Sprites size(8x8,8x16,16x16)
CONST TRUE
= -1, FALSE
= NOT TRUE
, None
= 0 CONST Up
= 3, Right
= 2, Left
= 1, Down
= 0, SELECT_BUTTON
= 4, START_BUTTON
= 5, BUTTON_B
= 6, BUTTON_A
= 7 CONST OverWorld
= 0, UnderWorld
= 1 CONST Walking
= 1, Useing
= 2, GetItem
= 3, GetTriforce
= 4, Attack
= 5 CONST Key_Right
= 19712, Key_Left
= 19200, Key_Up
= 18432, Key_Down
= 20480 CONST Key_Space
= 32, Key_Enter
= 13 CONST Default_Key_Right
= 19712, Default_Key_Left
= 19200, Default_Key_Up
= 18432, Default_Key_Down
= 20480 CONST Default_A_Button
= 32, Default_B_Button
= 13, Default_Start_Button
= 65, Default_Select_Button
= 66 CONST Sword
= 1, Arrow
= 2, Rock
= 3, Ball
= 4, Boomerang
= 5 CONST Player
= 1, Monster
= 2, KeyBoard
= -1, JoyPad
= 0, GO_IN
= 1, GO_OUT
= 2 CONST Items
= 0, Slash
= 1, Stairs
= 2, SwordShot
= 3
DIM SHARED KeyCodes
(134) AS KeyCodeData
, DeviceData
(16) AS DEVICE_Info
DIM SHARED Drop
(17) AS Drop_Data
, Item
(37) AS Item_Data
, Shop
(17, 3) AS Shop_Data
'-------------Graphical setup------------
Layer
(1) = _NEWIMAGE(800, 600, 32) 'temp layerLayer
(2) = _NEWIMAGE(640, 480, 256) 'palettized sprite sheet for color shiftingLayer
(3) = _NEWIMAGE(800, 600, 32) 'Map background prebuild layerLayer
(4) = _NEWIMAGE(800, 600, 32) 'Mob layerLayer
(5) = _NEWIMAGE(800, 600, 32) 'Sprite layer, moveable\burnable items + bomb holes + pickupsLayer
(6) = _NEWIMAGE(12288, 4224, 32) 'PreBuilt Map, upto 300%, for easier map scrolling.Layer
(8) = _NEWIMAGE(800, 600, 32) 'debug map displayLayer
(19) = _NEWIMAGE(800, 600, 32) 'item\creature collision layerMFI_Loader "Zelda.MFI"
'----------------------------------------
ON TIMER(TFX
(0), .016) Flame_Burn_Cave
'==================================
G.Scale_Factor = 2
G.Scale_X = 16 * G.Scale_Factor - 1
G.Scale_Y = 16 * G.Scale_Factor - 1
Link.Screen_X = Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor * 7) + 8 * G.Scale_Factor '392
Link.Screen_Y = Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor * 5) '292
Nick(0) = "": Nick(1) = "": Nick(2) = "": Nick(3) = ""
G.BGM_vol = 66
G.SFX_Vol = 75
G.MSTR_Vol = 100
'OPEN "debug.txt" FOR OUTPUT AS #6
'==================================
Get_JoyPads
G.ControlType = KeyBoard
Title_Screen
Select_Screen
Build_Map_Screen 16 * Link.World_X, 11 * Link.World_Y
ClearLayer Layer(6)
Build_Map_in_Totallity 'prebuild the entire map at the current scale factor
ClearLayer Layer(1)
IF Link.Action
<> GetItem
THEN IF G.Aframe
= 0 AND G.Atime
= 0 THEN _SNDPLAY SFX
(Slash
): Link.Action
= Attack: Press
= Press
+ 1 Check_Link_Sword_Shot
IF Link.Action
<> Attack
THEN Link.Direction
= Up: Link.Action
= Walking
IF Link.Action
<> Attack
THEN Link.Direction
= Down: Link.Action
= Walking
IF Link.Action
<> Attack
THEN Link.Direction
= Right: Link.Action
= Walking
IF Link.Action
<> Attack
THEN Link.Direction
= Left: Link.Action
= Walking
IF Link.Action
= Walking
THEN Link.Action
= None
IF Link.Action
= GetItem
OR Link.Action
= GetTriforce
THEN IF Link.World
= OverWorld
AND Hyrule
(Link.Tile_X
, Link.Tile_Y
).Is_Shop
THEN Enter_Shop Hyrule
(Link.Tile_X
, Link.Tile_Y
).Is_Shop
'-------Items code----------
IF G.ItemCount
THEN Age_items
'only run if there are items to age IF Link_Object_Collision
THEN Pickup_Item G.Collected
'---------------------------
'------Graphx build------
IF Link.Action
= Walking
THEN Move_Link
IF Link.Shot
THEN Move_Sword_Shot
IF G.Impactflag
THEN Impact
0, 0 IF G.ItemCount
THEN Display_drops
IF Link.Action
= GetItem
THEN Display_Lifted_Item
Place_Link
IF G.Scale_Factor
= 1 THEN _DEST Layer
(1):
LINE (100 + 2 * Link.Tile_X
, 0 + 2 * Link.Tile_Y
)-STEP(1, 1), _RGB32(255, 255, 0), BF
ClearLayer Layer(1)
'------------------------
SUB Add_Projectile
(What%%
, Who%%
) P(G.Projectile_Count).Owner = Who%%
P(G.Projectile_Count).Id = Sword
P(G.Projectile_Count).Direction = Link.Direction
P(G.Projectile_Count).Xloc = Link.Screen_X
P(G.Projectile_Count).Yloc = Link.Screen_Y
G.Projectile_Count = G.Projectile_Count + 1
FOR i%%
= 0 TO G.ItemCount
- 1 IF Drop
(i%%
).Death
> 0 THEN Drop
(i%%
).Death
= Drop
(i%%
).Death
- 1 'only age normal drops and live drops Reduce%% = Reduce%% + 1
Kill_Item i%%
G.ItemCount = G.ItemCount - Reduce%%
IF Reduce%%
<> 0 THEN Build_Item_Collision_layer
'update the collsion layer if some items have died off
SUB Remove_Projectile
(What%%
, Who%%
) G.Projectile_Count = G.Projectile_Count - 1
Place_Tile_On_Screen (16 * G.Scale_Factor) * X%%, (16 * G.Scale_Factor) * Y%%, Cave(X%%, Y%%).Id, Layer(3)
SUB Build_Item_Collision_layer
FOR i%%
= 0 TO G.ItemCount
- 1 LINE (Drop
(i%%
).Xloc
, Drop
(i%%
).Yloc
)-STEP(Item
(Drop
(i%%
).ID
).BoxSize_X
* G.Scale_Factor
- 1, Item
(Drop
(i%%
).ID
).BoxSize_Y
* G.Scale_Factor
- 1), _RGB32(1 + i%%
, 0, 100), BF
'item mask for collision
SUB Build_Map_Screen
(Map_X~%%
, Map_Y%%
) Place_Tile_On_Screen (16 * G.Scale_Factor) * X%%, (16 * G.Scale_Factor) * Y%%, Hyrule(Map_X~%% + X%%, Map_Y%% + Y%%).Id, Layer(3)
IF Hyrule
(x~%%
, Y%%
).Walkable
= FALSE
THEN LINE (100 + 2 * x~%%
, 0 + 2 * Y%%
)-STEP(1, 1), _RGB32(255), BF
SUB Build_Map_in_Totallity
tile~%% = Hyrule(X~%%, Y%%).Id
Gy% = 17 * (tile~%% \ 20) 'get which row it comes from
Gx%
= 17 * (tile~%%
MOD 20) 'which column position _PUTIMAGE ((16 * G.Scale_Factor
) * X~%%
, (16 * G.Scale_Factor
) * Y%%
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(6), (1 + Gx%
, 1 + Gy%
)-STEP(15, 15)
Ax% = Link.World_X * 16 * (16 * G.Scale_Factor) 'gets the Left most pixel point for the current map screen
Ay% = Link.World_Y * 11 * (16 * G.Scale_Factor) 'gets the Top most pixel point for the current map screen
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF Hyrule
(Tx~%%
, Ty%%
).Is_Shop
THEN Enter_Shop Hyrule
(Tx~%%
, Ty%%
).Is_Shop
SUB Check_Link_Sword_Shot
'Can Link shoot his sword? IF Link.Hearts
= Link.Containers
* 2 THEN 'Link has full hearts and can shoot IF NOT G.Impactflag
THEN 'Link's last shot has finished Link.Shot = TRUE
Add_Projectile Sword, Player
DIM Frac_Value
AS LONG: Frac_Value
= Value_From_0_To_1
* 65536 'Used to avoid slow floating point calculations O = Buffer.OFFSET 'We start at this offset
O_Last
= Buffer.OFFSET
+ _WIDTH(Image
) * _HEIGHT(Image
) * 4 'We stop when we get to this offset 'use on error free code ONLY!
O = O + 4
'turn checking back on when done!
FOR i%%
= 0 TO G.ItemCount
_PUTIMAGE (Drop
(i%%
).Xloc
, Drop
(i%%
).Yloc
)-STEP(Item
(Drop
(i%%
).ID
).BoxSize_X
* G.Scale_Factor
- 1, Item
(Drop
(i%%
).ID
).BoxSize_Y
* G.Scale_Factor
- 1), Layer
(7), Layer
(1), (Item
(Drop
(i%%
).ID
).Sprite_X
, Item
(Drop
(i%%
).ID
).Sprite_Y
)-STEP(Item
(Drop
(i%%
).ID
).BoxSize_X
- 1, Item
(Drop
(i%%
).ID
).BoxSize_Y
- 1)
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
- 16 * G.Scale_Factor
)-STEP(Item
(G.Collected
+ 1).BoxSize_X
* G.Scale_Factor
- 1, Item
(G.Collected
+ 1).BoxSize_Y
* G.Scale_Factor
- 1), Layer
(7), Layer
(1), (Item
(G.Collected
+ 1).Sprite_X
, Item
(G.Collected
+ 1).Sprite_Y
)-STEP(Item
(G.Collected
+ 1).BoxSize_X
- 1, Item
(G.Collected
+ 1).BoxSize_Y
- 1)
SUB Drop_Item
(Id%%
, X%
, Y%
, Status%%
) Drop(G.ItemCount).ID = Id%%
Drop(G.ItemCount).Xloc = X%
Drop(G.ItemCount).Yloc = Y%
Drop(G.ItemCount).Xsiz = Item(Id%%).BoxSize_X * G.Scale_Factor
Drop(G.ItemCount).Ysiz = Item(Id%%).BoxSize_X * G.Scale_Factor
Drop(G.ItemCount).Is_Special = Status%%
Drop(G.ItemCount).Death = 5400 'clicks[60 per second]
Drop(G.ItemCount).Death = -1 'special items dont die
G.ItemCount = G.ItemCount + 1
Build_Item_Collision_layer
'covers all cave screens; Shop\Gamble\Old Man\Old Woman\Information\Gifts\ and Thefts
IF NOT Hyrule
(Link.Tile_X
, Link.Tile_Y
).Burnable
THEN Walk_InOut GO_IN
Build_Cave_Screen
X% = Offset_X(G.Scale_Factor)
Y% = Offset_Y(G.Scale_Factor)
Link.World = UnderWorld
CASE 1 'get the wood sword 'place the old man
IF Link.Sword
= 0 THEN 'only show if player has not taken the wooden sword yet. _PRINTSTRING (X%
+ 16 * G.Scale_Factor
+ 64, Y%
+ 16 * G.Scale_Factor
+ 48), "It's dangerous to go", Layer
(3) _PRINTSTRING (X%
+ 16 * G.Scale_Factor
+ 96, Y%
+ 16 * G.Scale_Factor
+ 64), "alone, take this.", Layer
(3) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 7.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(17), Layer
(3), (1, 11)-STEP(15, 15) Drop_Item Shop(1, 1).Item, X% + (16 * G.Scale_Factor * 7.75), Y% + (16 * G.Scale_Factor * 5.5), TRUE
CASE 2 'Shop 1: Sheild 160, Key 100, Blue Candle 60 CASE 3 'old woman with life potions CASE 4 'Shop 2: Sheild 130, Bomb 20, Arrow 80 CASE 5 'Shop 3: Blue Ring 250, Key 80, Bait 60 CASE 6 'Old woman:"Meet the Old man":"At the Grave" CASE 7 'Old Woman: Informant CASE 8 'Old Man: Life bottle or Heart Container "Take any one you want" CASE 9 'Moblin: Gambling game CASE 10 'Old Man: "Show this to the":"Old woman" Get the Letter
DarkenImage i2&, n!
DarkenImage i2&, n!
FUNCTION Find_First_Available%%
(Which%%
, Start%%
) Selection%% = Start%% 'always start at the first saved game slot then check
DO 'lets find the first available selection (if there are any saved games) IF Which%%
= 0 THEN IF RTRIM$(Nick
(Selection%%
)) = "" THEN Selection%%
= Selection%%
+ 1 ELSE Good_Selection%%
= TRUE
IF Which%%
= 1 THEN IF RTRIM$(Nick
(Selection%%
)) = "" THEN Good_Selection%%
= TRUE
ELSE Selection%%
= Selection%%
+ 1 ELSE '4 and 5 are always good selections Good_Selection%% = TRUE
Find_First_Available = Selection%%
X% = Offset_X(G.Scale_Factor)
Y% = Offset_Y(G.Scale_Factor)
_PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 4.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(3), (290, 256)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 10.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(3), (290, 256)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 4.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(17), Layer
(3), (52, 11)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 10.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(17), Layer
(3), (52, 11)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 5.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(-G.Scale_X
, G.Scale_Y
), Layer
(17), Layer
(3), (52, 11)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 11.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(-G.Scale_X
, G.Scale_Y
), Layer
(17), Layer
(3), (52, 11)-STEP(15, 15) Tick%% = Tick%% + 1
IF Tick%%
= 8 THEN Frame%%
= NOT Frame%%: Tick%%
= 0
Result%% = TRUE '-1 for no input
CASE TRUE
'Keyboard input IF _KEYDOWN(C.KBCon_Select
) THEN Result%%
= SELECT_BUTTON:
' DO: LOOP WHILE _KEYDOWN(C.KBCon_Select) IF _KEYDOWN(C.KBCon_Start
) THEN Result%%
= START_BUTTON:
' DO: LOOP WHILE _KEYDOWN(C.KBCon_Start) IF _KEYDOWN(C.KBCon_A_Button
) THEN Result%%
= BUTTON_A:
' DO: LOOP WHILE _KEYDOWN(C.KBCon_A_Button) IF _KEYDOWN(C.KBCon_B_Button
) THEN Result%%
= BUTTON_B:
' DO: LOOP WHILE _KEYDOWN(C.KBCon_B_Button) CASE FALSE
'joystick input nul%% = AxisPower(CJR%%, CJL%%, CJU%%, CJD%%) 'read directional axis values
IF CJR%%
THEN Result%%
= Right
IF _BUTTON(C.Joy_Button_Up
) THEN Result%%
= Up
': Joy_Lock_Button (C.Joy_Button_Up) IF _BUTTON(C.Joy_Button_Down
) THEN Result%%
= Down
': Joy_Lock_Button (C.Joy_Button_Down) IF _BUTTON(C.Joy_Button_Left
) THEN Result%%
= Left
': Joy_Lock_Button (C.Joy_Button_Left) IF _BUTTON(C.Joy_Button_Right
) THEN Result%%
= Right
': Joy_Lock_Button (C.Joy_Button_Right) IF _BUTTON(C.Joy_Select
) THEN Result%%
= SELECT_BUTTON
': Joy_Lock_Button (C.Joy_Select) IF _BUTTON(C.Joy_Start
) THEN Result%%
= START_BUTTON
': Joy_Lock_Button (C.Joy_Start) IF _BUTTON(C.Joy_A_Button
) THEN Result%%
= BUTTON_A
': Joy_Lock_Button (C.Joy_A_Button) IF _BUTTON(C.Joy_B_Button
) THEN Result%%
= BUTTON_B
': Joy_Lock_Button (C.Joy_B_Button) Get_Input = Result%%
Fstp = 0
FOR i%%
= 0 TO 3: Xloc
(i%%
) = X%
+ 8 * G.Scale_Factor: Yloc
(i%%
) = Y%
+ 8 * G.Scale_Factor:
NEXT i%%
Xloc(0) = Xloc(0) - G.Scale_Factor: Yloc(0) = Yloc(0) - G.Scale_Factor
Xloc(1) = Xloc(1) + G.Scale_Factor: Yloc(1) = Yloc(1) - G.Scale_Factor
Xloc(2) = Xloc(2) + G.Scale_Factor: Yloc(2) = Yloc(2) + G.Scale_Factor
Xloc(3) = Xloc(3) - G.Scale_Factor: Yloc(3) = Yloc(3) + G.Scale_Factor
_PUTIMAGE (Xloc
(i%%
) - 16, Yloc
(i%%
) - 16)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (205 + 17 * Frame
, 205)-STEP(15, 15) _PUTIMAGE (Xloc
(i%%
) + 16, Yloc
(i%%
) - 16)-STEP(-G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (205 + 17 * Frame
, 205)-STEP(15, 15) _PUTIMAGE (Xloc
(i%%
) + 16, Yloc
(i%%
) + 16)-STEP(-G.Scale_X
, -G.Scale_Y
), Layer
(7), Layer
(1), (205 + 17 * Frame
, 205)-STEP(15, 15) _PUTIMAGE (Xloc
(i%%
) - 16, Yloc
(i%%
) + 16)-STEP(G.Scale_X
, -G.Scale_Y
), Layer
(7), Layer
(1), (205 + 17 * Frame
, 205)-STEP(15, 15) Fstp = Fstp + 1
Frame = Frame + 1
IF Fstp
= 16 THEN Frame
= -1: G.Impactflag
= FALSE
Drop(I%%) = Drop(17) 'erase data in this drop(#17 is always blank)
FOR j%%
= I%%
TO G.ItemCount
SWAP Drop
(j%%
), Drop
(I%%
)
Ox%% = 0: Oy%% = -14 * G.Scale_Factor
Ox%% = 0: Oy%% = 14 * G.Scale_Factor
Ox%% = -14 * G.Scale_Factor + G.Aframe * (4 * G.Scale_Factor): Oy%% = 0
Ox%% = 14 * G.Scale_Factor - G.Aframe * (4 * G.Scale_Factor): Oy%% = 0
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * (Link.Direction
+ 8), 137)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * (Link.Direction
+ 8), 137)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
+ Ox%%
, Link.Screen_Y
+ Oy%%
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 51 * Link.Weapon
, 171 + 17 * Link.Direction
)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17, 137)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
+ Ox%%
, Link.Screen_Y
+ Oy%%
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 51 * Link.Weapon
+ 17, 171 + 17 * Link.Direction
)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 0, 137)-STEP(15, 15) _PUTIMAGE (Link.Screen_X
+ Ox%%
, Link.Screen_Y
+ Oy%%
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 51 * Link.Weapon
+ 34, 171 + 17 * Link.Direction
)-STEP(15, 15) G.Atime = 0: G.Aframe = 0: Link.Action = None
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * Frame%%
, 137)-STEP(15, 15)
Result%% = FALSE 'start at no collision
'get links center point x\y tile position to check for collision
Ax% = Link.World_X * 16 * (16 * G.Scale_Factor) 'gets the Left most pixel point for the current map screen
Ay% = Link.World_Y * 11 * (16 * G.Scale_Factor) 'gets the Top most pixel point for the current map screen
'we now have the tile that Links center pixel is in!
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Hyrule
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (2 + Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + 2 * G.Scale_Factor + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Hyrule
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Hyrule
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (2 + Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + 2 * G.Scale_Factor + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Hyrule
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Link.Tile_X = Tx~%%
Link.Tile_Y = Ty%%
'get links center point x\y tile position to check for collision
Ax% = 0 'Link.World_X * 16 * (16 * G.Scale_Factor) 'gets the Left most pixel point for the current map screen
Ay% = 0 'Link.World_Y * 11 * (16 * G.Scale_Factor) 'gets the Top most pixel point for the current map screen
'we now have the tile that Links center pixel is in!
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Cave
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (2 + Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + 2 * G.Scale_Factor + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Cave
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) - 2 + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Cave
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Tx~%% = (2 + Ax% + Link.Screen_X - Offset_X(G.Scale_Factor) + 2 * G.Scale_Factor + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent x-offset+50% sprite size
Ty%% = (Ay% + Link.Screen_Y - Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor \ 2)) \ 16 * G.Scale_Factor 'now add curent y-offset+50% sprite size
IF NOT Cave
(Tx~%%
, Ty%%
).Walkable
THEN Result%%
= TRUE
Link_Collision = Result%%
Result%% = FALSE
FOR y%%
= 0 TO 8 * G.Scale_Factor
FOR x%%
= 0 TO 8 * G.Scale_Factor
IF _RED32(POINT(x%%
+ Link.Screen_X
+ 4 * G.Scale_Factor
, y%%
+ Link.Screen_Y
+ 4 * G.Scale_Factor
)) <> 0 THEN G.Collected
= _RED32(POINT(x%%
+ Link.Screen_X
+ 4 * G.Scale_Factor
, y%%
+ Link.Screen_Y
+ 4 * G.Scale_Factor
)) - 1 Result%% = TRUE
x%% = 8 * G.Scale_Factor + 1: y%% = 8 * G.Scale_Factor + 1
Link_Object_Collision = Result%%
IF NOT Link_Collision
(Up
) THEN 'nothing blocking Link IF Link.Screen_Y
> Offset_Y
(G.Scale_Factor
) THEN 'Link is not at the edge of the screen Link.Screen_Y = Link.Screen_Y - 2 * G.Scale_Factor
ELSE 'player is at edge of screen to shift to next one. G.NextScreen = Up
Shift_New_Map_Screen
IF NOT Link_Collision
(Down
) THEN 'nothing blocking Link IF Link.Screen_Y
< (Offset_Y
(G.Scale_Factor
) + (16 * G.Scale_Factor
* 10)) THEN 'Link is not at the edge of the screen Link.Screen_Y = Link.Screen_Y + 2 * G.Scale_Factor
ELSEIF Link.World
= OverWorld
THEN 'player is at edge of screen to shift to next one. G.NextScreen = Down
Shift_New_Map_Screen
ELSE 'link is in the underworld Walk_InOut GO_OUT
IF NOT Link_Collision
(Left
) THEN 'nothing blocking Link IF Link.Screen_X
> Offset_X
(G.Scale_Factor
) THEN 'Link is not at the edge of the screen Link.Screen_X = Link.Screen_X - 2 * G.Scale_Factor
ELSE 'player is at edge of screen to shift to next one. G.NextScreen = Left
Shift_New_Map_Screen
IF NOT Link_Collision
(Right
) THEN 'nothing blocking Link IF Link.Screen_X
< (Offset_X
(G.Scale_Factor
) + (16 * G.Scale_Factor
* 15)) THEN 'Link is not at the edge of the screen Link.Screen_X = Link.Screen_X + 2 * G.Scale_Factor
ELSE 'player is at edge of screen to shift to next one. G.NextScreen = Right
Shift_New_Map_Screen
IF Direction
= -1 OR Xloc
= 0 THEN 'if no direction assigned then assign one Direction = Link.Direction
Xloc = Link.Screen_X
Yloc = Link.Screen_Y
Yloc = Yloc - 4 * G.Scale_Factor
Yloc = Yloc + 4 * G.Scale_Factor
Xloc = Xloc - 4 * G.Scale_Factor
Xloc = Xloc + 4 * G.Scale_Factor
_PUTIMAGE (Xloc
, Yloc
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * Frame
+ 68 * Direction
, 239)-STEP(15, 15) IF Xloc
<= 272 OR Xloc
>= 514 OR Yloc
<= 212 OR Yloc
>= 372 THEN Done%%
= TRUE
IF Xloc
<= 140 OR Xloc
>= 630 OR Yloc
<= 100 OR Yloc
>= 430 THEN Done%%
= TRUE
IF Xloc
<= 16 OR Xloc
>= 744 OR Yloc
<= 96 OR Yloc
>= 559 THEN Done%%
= TRUE
IF Done%%
THEN Link.Shot
= FALSE: G.Impactflag
= TRUE: Impact Xloc
, Yloc: Direction
= -1: Remove_Projectile Sword
, Player
Fstp = Fstp + 1
IF Fstp
= 2 THEN Fstp
= 0: Frame
= Frame
+ 1
X% = Offset_X(G.Scale_Factor)
Y% = Offset_Y(G.Scale_Factor)
IF Drop
(Id%%
).Is_Special
THEN _SNDPLAY SFX
(Items
): Link.Action
= GetItem
Link.Sword = Drop(Id%%).ID
Link.Has_Bow = TRUE
Link.Has_Wand = TRUE
Link.Has_Bait = TRUE
Link.Has_Arrow = Drop(Id%%).ID - 6 '1-arrow, 2-Silver arrow
Link.Has_Boomerang = Drop(Id%%).ID - 8 '1-wood boomerang, 2-magic boomerang
IF Drop
(Id%%
).Is_Special
OR Drop
(Id%%
).Death
= TRUE
THEN ' Link.Max_Bombs = Link.Max_Bombs + 4
Link.Has_Bombs = Link.Has_Bombs + 4
IF Link.Has_Bombs
> Link.Max_Bombs
THEN Link.Has_Bombs
= Link.Max_Bombs
CASE 12, 13, 14 'letter, Blue and Red potions Link.Has_Letter = Drop(Id%%).ID - 11
Link.Has_Book = TRUE
Link.Has_Raft = TRUE
Link.Has_Ladder = TRUE
Link.Hearts = Link.Hearts + 2
IF Link.Hearts
> Link.Containers
* 2 THEN Link.Hearts
= Link.Containers
* 2 Link.Containers = Link.Containers + 1
IF Link.Ruby
+ 1 <= 255 THEN Link.Ruby
= Link.Ruby
+ 1 test% = Link.Ruby + 5
IF test%
> 255 THEN Link.Ruby
= 255 ELSE Link.Ruby
= Link.Ruby
+ 5 CASE 27, 28 'Blue, Red Candle Link.Has_Candle = Drop(Id%%).ID - 26
Link.Has_Ring = Drop(Id%%).ID - 28
Link.Has_Shield = TRUE
Link.Has_Bracelet = TRUE
IF Link.Keys
< 8 THEN Link.Keys
= Link.Keys
+ 1 Link.Has_MagicKey = TRUE
Kill_Item G.Collected 'remove the item from the Drop array
G.ItemCount = G.ItemCount - 1
Build_Item_Collision_layer
IF Link.World
= UnderWorld
THEN X% = Offset_X(G.Scale_Factor)
Y% = Offset_Y(G.Scale_Factor)
_PUTIMAGE (X%
+ 16 * G.Scale_Factor
+ 64, Y%
+ 16 * G.Scale_Factor
+ 48)-STEP(352, 48), Layer
(7), Layer
(3), (290, 256)-STEP(15, 15) _PUTIMAGE (X%
+ (16 * G.Scale_Factor
* 7.5), Y%
+ (16 * G.Scale_Factor
* 4))-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(3), (290, 256)-STEP(15, 15)
IF Link.Action
= Walking
THEN 'while Link is moving G.Wtime = G.Wtime + 1 'Increment frame time
IF G.Wframe
THEN G.Wframe
= 0 ELSE G.Wframe
= 1 'change frame G.Wtime = 0 'reset frame time
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * G.Wframe
, 137)-STEP(15, 15) ELSEIF Link.Action
= Useing
THEN 'when Link uses an item Ftime = Ftime + 1 'Increment frame time
IF Ftime
= 32 THEN Link.Action
= None: Ftime
= 0 'action is done _PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * (Link.Direction
+ 8), 137)-STEP(15, 15) ELSEIF Link.Action
= GetItem
THEN 'When Link gets a sword\item or buys something 'Held while music plays
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * 12, 137)-STEP(15, 15) ELSEIF Link.Action
= GetTriforce
THEN 'When Link recovers a Triforce piece 'Held while music plays
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 17 * 13, 137)-STEP(15, 15) G.Atime = G.Atime + 1 'Increment frame time
IF G.Atime
= 4 THEN G.Aframe
= G.Aframe
+ 1: G.Atime
= 0 'change frame:reset frame time Link_Attack
ELSE 'Link is standing Still(Action=None) G.Atime = 0: G.Aframe = 0
G.Wtime = 0: G.Wframe = 0
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * Frame%%
, 137)-STEP(15, 15)
SUB Place_Player_Record
(I%%
, Where%
) IF Records
(I%%
+ 1).Beaten
THEN _PUTIMAGE (260, 228 + 48 * I%%
)-STEP(15, 31), Layer
(12), Layer
(16), (64, 247)-STEP(7, 15) 'Player 1 Sword _PUTIMAGE (236, 234 + 48 * I%%
)-STEP(31, 31), Layer
(12), Layer
(16), (1 + 17 * Records
(I%%
+ 1).Ring
, 230)-STEP(15, 15) 'Player 1 Link (green) FOR j%%
= 1 TO Records
(I%%
+ 1).Containers
IF j%%
< 4 THEN 'first 3 hearts are red _PUTIMAGE (428 + 16 * j%%
, 232 + 48 * I%%
)-STEP(15, 15), Layer
(12), Layer
(16), (52, 230)-STEP(7, 7) 'Player 1 hearts red _PUTIMAGE (428 + 16 * j%%
, 232 + 48 * I%%
)-STEP(15, 15), Layer
(12), Layer
(16), (73, 267)-STEP(7, 7) 'Player 1 hearts white _PUTIMAGE (428 + 16 * (j%%
- 8), 232 + 64 * I%%
)-STEP(15, 15), Layer
(12), Layer
(16), (73, 267)-STEP(7, 7) 'Player 1 hearts white IF Records
(I%%
+ 1).Beaten
THEN _PUTIMAGE (326, 148 + 48 * (I%%
- 1))-STEP(15, 31), Layer
(12), Layer
(16), (64, 247)-STEP(7, 15) 'Player 1 Sword _PUTIMAGE (300, 154 + 48 * (I%%
))-STEP(31, 31), Layer
(12), Layer
(16), (1 + 17 * Records
(I%%
+ 1).Ring
, 230)-STEP(15, 15) 'Player 1 Link (green)
SUB Place_Tile_On_Screen
(X%
, Y%
, Tile~%%
, L&
) Gy% = 17 * (Tile~%% \ 20) 'get which row it comes from
Gx%
= 17 * (Tile~%%
MOD 20) 'which column position _PUTIMAGE (Offset_X
(G.Scale_Factor
) + X%
, Offset_Y
(G.Scale_Factor
) + Y%
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), L&
, (1 + Gx%
, 1 + Gy%
)-STEP(15, 15)
SUB Scroll_Screen_II
(Dir%%
) Cx% = Offset_X(G.Scale_Factor) 'top left corner location of map displayed
Cy% = Offset_Y(G.Scale_Factor)
Sfx% = 16 * 16 * G.Scale_Factor 'size of the map display
Sfy% = 11 * 16 * G.Scale_Factor
Lwx% = 16 * 16 * G.Scale_Factor * Link.World_X 'map area link is in
Lwy% = 11 * 16 * G.Scale_Factor * Link.World_Y
_PUTIMAGE (Cx%
, Cy%
)-STEP(Sfx%
, Sfy%
), Layer
(6), Layer
(1), (Lwx%
, Lwy%
- y%
)-STEP(Sfx%
, Sfy%
) IF y%
> 16 * G.Scale_Factor
THEN Link.Screen_Y
= Link.Screen_Y
+ 2 * G.Scale_Factor
Place_Link
Link.World_Y = Link.World_Y - 1
_PUTIMAGE (Cx%
, Cy%
)-STEP(Sfx%
, Sfy%
), Layer
(6), Layer
(1), (Lwx%
, Lwy%
+ y%
)-STEP(Sfx%
, Sfy%
) IF y%
> 16 * G.Scale_Factor
THEN Link.Screen_Y
= Link.Screen_Y
- 2 * G.Scale_Factor
Place_Link
Link.World_Y = Link.World_Y + 1
_PUTIMAGE (Cx%
, Cy%
)-STEP(Sfx%
, Sfy%
), Layer
(6), Layer
(1), (Lwx%
- x%
, Lwy%
)-STEP(Sfx%
, Sfy%
) IF x%
> 16 * G.Scale_Factor
THEN Link.Screen_X
= Link.Screen_X
+ 2 * G.Scale_Factor
Place_Link
Link.World_X = Link.World_X - 1
_PUTIMAGE (Cx%
, Cy%
)-STEP(Sfx%
, Sfy%
), Layer
(6), Layer
(1), (Lwx%
+ x%
, Lwy%
)-STEP(Sfx%
, Sfy%
) IF x%
> 16 * G.Scale_Factor
THEN Link.Screen_X
= Link.Screen_X
- 2 * G.Scale_Factor
Place_Link
Link.World_X = Link.World_X + 1
Place_Link
Lwx% = 16 * 16 * G.Scale_Factor * Link.World_X
Lwy% = 11 * 16 * G.Scale_Factor * Link.World_Y
_PUTIMAGE (Cx%
, Cy%
)-STEP(Sfx%
, Sfy%
), Layer
(6), Layer
(3), (Lwx%
, Lwy%
)-STEP(Sfx%
, Sfy%
) 'move new screen to layer(3)
Scroll_Screen_II Up
Scroll_Screen_II Down
Scroll_Screen_II Left
Scroll_Screen_II Right
G.NextScreen = -1
F%% = 0: F% = 0: ExitFlag%% = FALSE
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (0, 0)-STEP(255, 223) _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer
(9), Layer
(1), (289, 0)-STEP(71, 71) _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer
(9), Layer
(1), (289, 0 + 72)-STEP(71, 71) _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer
(9), Layer
(1), (289, 0 + 144)-STEP(71, 71) _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer
(9), Layer
(1), (289, 0 + 72)-STEP(71, 71) _PUTIMAGE (400 - 74, 300 - 128)-STEP(143, 143), Layer
(9), Layer
(1), (289, 0 + 0)-STEP(71, 71) _PUTIMAGE (304, 523 - 112), Layer
(10), Layer
(1), (0 + 64 * wave%%
, 0)-STEP(63, 111) F%% = F%% + 1
IF wave%%
= 16 THEN wave%%
= 0 IF Get_Input
= START_BUTTON
THEN ExitFlag%%
= TRUE
'start the title fade
F%% = 0
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (361, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (361, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (361, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (617, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (617, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (617, 0)-STEP(255, 223) _PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (873, 0)-STEP(255, 223) Wf% = 112
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (1129, 0)-STEP(255, 223) Wf% = 224
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (1385, 0)-STEP(255, 223) Wf% = 336
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (1641, 0)-STEP(255, 223) Wf% = 448
_PUTIMAGE ((800 - 512) \
2, (600 - 448) \
2)-STEP(511, 447), Layer
(9), Layer
(1), (1897, 0)-STEP(255, 223) Wf% = 560
_PUTIMAGE (304, 523 - 112), Layer
(10), Layer
(1), (0 + 64 * wave%%
, 0 + Wf%
)-STEP(63, 111) F% = F% + 1
IF F%
= 394 THEN ExitFlag%%
= TRUE
IF wave%%
= 16 THEN wave%%
= 0 IF Get_Input
= START_BUTTON
THEN ExitFlag%%
= TRUE
ExitFlag%% = FALSE
ClearLayer Layer(0)
ClearLayer Layer(1)
'Title scroll
F% = 0
_PUTIMAGE (144, 76)-STEP(511, 447), Layer
(11), Layer
(1), (0, -223 + F%
)-STEP(255, 223) _PUTIMAGE (120, 1432)-STEP(15, 15), Layer
(7), Layer
(11), (239, 188)-STEP(15, 15) 'Triforce _PUTIMAGE (120, 1432)-STEP(15, 15), Layer
(7), Layer
(11), (222, 188)-STEP(15, 15) 'Triforce _PUTIMAGE (72, 400)-STEP(7, 15), Layer
(7), Layer
(11), (256, 188)-STEP(7, 15) 'fairy blank _PUTIMAGE (72, 400)-STEP(7, 15), Layer
(7), Layer
(11), (256, 188)-STEP(7, 15) 'fairy blank _PUTIMAGE (144, 76)-STEP(511, 447), Layer
(11), Layer
(1), (0, F%
- 354)-STEP(255, 223) F% = F% + 1
IF F%
= 1762 THEN F%
= F%
- 1 'ExitFlag%% = TRUE B% = B% + 1
IF Get_Input
= START_BUTTON
THEN ExitFlag%%
= TRUE
ExitFlag%% = FALSE
Result%% = FALSE
FOR i%%
= 0 TO G.Projectile_Count
Projectile_Collision = Result%%
STATIC Shrink%%
, Entry_X
, Entry_Y
MoveY%% = 2
MoveY%% = 5
MoveY%% = 8
Link.Screen_X = 16 * G.Scale_Factor * (Link.Tile_X - Link.World_X * 16) + Offset_X(G.Scale_Factor)
FOR y%
= 0 TO MoveY%%
'move link into the cave opening _PUTIMAGE , Layer
(3), Layer
(1) 'place map image G.Wtime = G.Wtime + 1 'Increment frame time
IF G.Wframe
THEN G.Wframe
= 0 ELSE G.Wframe
= 1 'change frame G.Wtime = 0 'reset frame time
Link.Screen_Y = Link.Screen_Y - 2
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * G.Wframe
, 137)-STEP(15, 15)
DO 'have link walk `down` into the cave _PUTIMAGE , Layer
(3), Layer
(1) 'place map image
G.Wtime = G.Wtime + 1 'Increment frame time
Shrink%% = Shrink%% + 2
Link.Screen_Y = Link.Screen_Y + 2 * G.Scale_Factor
IF G.Wframe
THEN G.Wframe
= 0 ELSE G.Wframe
= 1 'change frame G.Wtime = 0 'reset frame time
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
- Shrink%%
* G.Scale_Factor
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * G.Wframe
, 137)-STEP(15, 15 - Shrink%%
) Entry_X = Link.Screen_X
Entry_Y = Link.Screen_Y
Link.Screen_X = Offset_X(G.Scale_Factor) + 16 * G.Scale_Factor * 7.5
Link.Screen_Y = Offset_Y(G.Scale_Factor) + 16 * G.Scale_Factor * 9
Build_Map_Screen 16 * Link.World_X, 11 * Link.World_Y
Link.Screen_X = Entry_X 'Offset_X(G.Scale_Factor) + 16 * G.Scale_Factor * (Link.Tile_X - Link.World_X * 16)
Link.Screen_Y = Entry_Y 'Offset_Y(G.Scale_Factor) + 16 * G.Scale_Factor * (Link.Tile_Y - Link.World_Y * 11)
DO 'have link walk `down` into the cave _PUTIMAGE , Layer
(3), Layer
(1) 'place map image
G.Wtime = G.Wtime + 1 'Increment frame time
Shrink%% = Shrink%% - 2
Link.Screen_Y = Link.Screen_Y - 2 * G.Scale_Factor
IF G.Wframe
THEN G.Wframe
= 0 ELSE G.Wframe
= 1 'change frame G.Wtime = 0 'reset frame time
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
- Shrink%%
* G.Scale_Factor
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * G.Wframe
, 137)-STEP(15, 15 - Shrink%%
)
FOR y%
= 0 TO 16 'move link into the cave opening _PUTIMAGE , Layer
(3), Layer
(1) 'place map image G.Wtime = G.Wtime + 1 'Increment frame time
IF G.Wframe
THEN G.Wframe
= 0 ELSE G.Wframe
= 1 'change frame G.Wtime = 0 'reset frame time
Link.Screen_Y = Link.Screen_Y + 2
_PUTIMAGE (Link.Screen_X
, Link.Screen_Y
)-STEP(G.Scale_X
, G.Scale_Y
), Layer
(7), Layer
(1), (1 + 34 * Link.Direction
+ 17 * G.Wframe
, 137)-STEP(15, 15)
Link.World = OverWorld
Link.Tile_Y = Link.Tile_Y + 1
Shrink%% = 0
SUB Build_Custom_Control_Screen
(L&
()) 'setup custom controls screen
'up arrow
LINE (208, 168)-(112, 172), _RGB32(255, 127, 0), BF
LINE (112, 172)-(116, 500), _RGB32(255, 127, 0), BF
LINE (112, 500)-(292, 504), _RGB32(255, 127, 0), BF
'left arrow
LINE (172, 200)-(128, 204), _RGB32(92, 192, 0), BF
LINE (128, 204)-(132, 456), _RGB32(92, 192, 0), BF
LINE (128, 456)-(320, 460), _RGB32(92, 192, 0), BF
'down arrow
LINE (208, 252)-(144, 256), _RGB32(0, 127, 255), BF
LINE (144, 256)-(148, 412), _RGB32(0, 127, 255), BF
LINE (144, 412)-(336, 416), _RGB32(0, 127, 255), BF
'right arrow
LINE (256, 224)-(260, 280), _RGB32(0, 64, 160), BF
LINE (160, 280)-(260, 284), _RGB32(0, 64, 160), BF
LINE (160, 284)-(164, 366), _RGB32(0, 64, 160), BF
LINE (160, 366)-(340, 370), _RGB32(0, 64, 160), BF
'select
LINE (344, 252)-(348, 500), _RGB32(255, 64, 0), BF
LINE (344, 500)-(516, 504), _RGB32(255, 64, 0), BF
'start
LINE (408, 252)-(412, 456), _RGB32(212, 0, 16), BF
LINE (408, 456)-(576, 460), _RGB32(212, 0, 16), BF
'B Button
LINE (506, 248)-(510, 296), _RGB32(64, 92, 212), BF
LINE (420, 296)-(510, 300), _RGB32(64, 92, 212), BF
LINE (420, 300)-(424, 416), _RGB32(64, 92, 212), BF
LINE (420, 412)-(576, 416), _RGB32(64, 92, 212), BF
'A Button
LINE (576, 248)-(580, 312), _RGB32(80, 64, 180), BF
LINE (436, 312)-(580, 316), _RGB32(80, 64, 180), BF
LINE (436, 312)-(440, 368), _RGB32(80, 64, 180), BF
LINE (436, 368)-(608, 372), _RGB32(80, 64, 180), BF
'setup click layer 40,32 offset
_PRINTSTRING (96, 0), "Click on the controller button you wish to customize, Press the new key.", L&
(2) _PRINTSTRING (144, 16), "Tab to switch Control type. When done click EXIT when done.", L&
(2) _PRINTSTRING (96, 32), "With a JOYPAD: TYPE I-use axis for movement, TYPE II-use buttons to move.", L&
(2)
ClearLayer Clayer(2)
ClearLayerTrans Clayer(4)
Build_Custom_Control_Screen Clayer()
IF KBD&
< 0 THEN KBD&
= 0 'handle button up `-` codes
Selection%%
= _RED32(POINT(X%
, Y%
)) 'is mouse over anything?
IF Master%%
THEN Selection%%
= Master%%
'keep selection locked until key press
IF NOT Master%%
THEN Master%%
= Selection%%
'if no Master selection set then set it. IF ExitSet%%
THEN ExitFlag%%
= TRUE
IF X%
> 640 AND X%
< 770 AND Y%
> 440 AND Y%
< 475 THEN C.BAD_Pad
= NOT C.BAD_Pad
'toggle controller directional type
IF Master%%
AND G.ControlType
THEN 'once player clicks and controller is Keyboard Set_KeyBoard_Control Master%%, KBD&
ELSEIF Master%%
AND (NOT G.ControlType
) THEN 'once player clicks and controller is Joy Pad C.Joy_Up = Aselect%%
IF test%%
< 0 THEN C.Joy_Up_Val
= TRUE
ELSE C.Joy_Up_Val
= 1 Master%% = FALSE 'unlock selection with button press
Aselect%% = 0
C.Joy_Button_Up = Bselect%%
Master%% = FALSE 'unlock selection with button press
Bselect%% = 0
C.Joy_Down = Aselect%%
IF test%%
< 0 THEN C.Joy_Down_Val
= TRUE
ELSE C.Joy_Down_Val
= 1 Master%% = FALSE 'unlock selection with button press
Aselect%% = 0
C.Joy_Button_Down = Bselect%%
Master%% = FALSE 'unlock selection with button press
Bselect%% = 0
C.Joy_Left = Aselect%%
IF test%%
< 0 THEN C.Joy_Left_Val
= TRUE
ELSE C.Joy_Left_Val
= 1 Master%% = FALSE 'unlock selection with button press
Aselect%% = 0
C.Joy_Button_Left = Bselect%%
Master%% = FALSE 'unlock selection with button press
Bselect%% = 0
C.Joy_Right = Aselect%%
IF test%%
< 0 THEN C.Joy_Right_Val
= TRUE
ELSE C.Joy_Right_Val
= 1 Master%% = FALSE 'unlock selection with button press
Aselect%% = 0
C.Joy_Button_Right = Bselect%%
Master%% = FALSE 'unlock selection with button press
Bselect%% = 0
IF Bselect%%
THEN C.Joy_Select
= Bselect%%: Master%%
= FALSE
'unlock selection with button press Bselect%% = 0
IF Bselect%%
THEN C.Joy_Start
= Bselect%%: Master%%
= FALSE
'unlock selection with button press Bselect%% = 0
IF Bselect%%
THEN C.Joy_B_Button
= Bselect%%: Master%%
= FALSE
'unlock selection with button press Bselect%% = 0
IF Bselect%%
THEN C.Joy_A_Button
= Bselect%%: Master%%
= FALSE
'unlock selection with button press Bselect%% = 0
IF KBD&
= 9 THEN G.ControlType
= NOT G.ControlType
': LINE (128, 350)-STEP(496, 160), _RGB32(0), BF IF (NOT G.ControlType
) AND C.Control_Pad
= 0 THEN 'setup joy pad IF G.Device_Count
<= 2 THEN 'is there a joy pad to use? _PUTIMAGE (188, 100)-STEP(384, 48), Layer
(12), Clayer
(0), (86, 240)-STEP(7, 7) 'black out name _PRINTSTRING (192, 108), " NO OTHER DEVICE FOUND", Clayer
(0) G.ControlType = TRUE
Select_Device
'Screen Updating
Display_Keys G.ControlType
Highlite_Select Selection%%
ExitSet%% = Display_Exit_Controls(X%, Y%)
IF NOT G.ControlType
THEN Display_BAD_Controller_Option
'---------------------------------------------------------------------------------------------------------
' _PUTIMAGE , Clayer(4), Clayer(1)
'removing the first 2 devices, assuming keyboard=1 and mouse=2
' Draw_Window 4, 7, 30, 1 + (G.Device_Count - 2) * 2, Layer(1)
FOR i%%
= 3 TO G.Device_Count
temp$ = Device_Name$(i%%)
_PRINTSTRING (16 * 6 + 8, 16 * (8 + (i%%
- 3)) + 2), "Press Number of controller" IF VAL(KBD$
) > 2 AND VAL(KBD$
) <= G.Device_Count
THEN C.Control_Pad
= VAL(KBD$
): ExitFlag%%
= TRUE
ELSE 'if there is only 1 control device to choose from auto assign C.Control_Pad = 3
IF C.Joy_Down_Val
< 0 THEN a$
= " -" ELSE a$
= " +" IF C.Joy_Left_Val
< 0 THEN a$
= " -" ELSE a$
= " +" IF C.Joy_Right_Val
< 0 THEN a$
= " -" ELSE a$
= " +" IF C.Joy_Button_Down
= -22 THEN IF C.Joy_Button_Left
= -22 THEN IF C.Joy_Button_Right
= -22 THEN
FUNCTION Display_Exit_Controls%%
(X%
, Y%
) Result%% = TRUE
Result%% = FALSE
Display_Exit_Controls = Result%%
SUB Set_KeyBoard_Control
(Master%%
, KBD&
) IF KBD&
THEN C.KBCon_Up
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_Down
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_Left
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_Right
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_Select
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_Start
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_B_Button
= KBD&: Master%%
= FALSE
'unlock selection with key press IF KBD&
THEN C.KBCon_A_Button
= KBD&: Master%%
= FALSE
'unlock selection with key press
SUB Highlite_Select
(ID%%
) IF ID%%
THEN Factor%%
= Factor%%
+ 16 'mouse over highlight color shift IF Factor%%
>= 120 THEN Factor%%
= 0 SELECT CASE ID%%
'highlight which control mouse is over. LINE (112, 500)-(292, 504), _RGB32(255 - Factor%%
, 127 + Factor%%
, 0 + Factor%%
), BF
LINE (144, 412)-(336, 416), _RGB32(0 + Factor%%
, 127 - Factor%%
, 255 - Factor%%
), BF
LINE (128, 456)-(320, 460), _RGB32(92 + Factor%%
, 192 - Factor%%
, 0 + Factor%%
), BF
LINE (160, 366)-(340, 370), _RGB32(0 + Factor%%
, 64 + Factor%%
, 160 - Factor%%
), BF
LINE (344, 500)-(496, 504), _RGB32(255 - Factor%%
, 64 + Factor%%
, 0 - Factor%%
), BF
LINE (408, 456)-(576, 460), _RGB32(212 - Factor%%
, 0 + Factor%%
, 16 + Factor%%
), BF
LINE (420, 412)-(576, 416), _RGB32(64 + Factor%%
, 92 + Factor%%
, 212 - Factor%%
), BF
LINE (436, 368)-(608, 372), _RGB32(80 + Factor%%
, 64 + Factor%%
, 180 - Factor%%
), BF
'load input device details Max:16
IF G.Device_Count
> 16 THEN G.Device_Count
= 16 'limit total devices to 16 FOR I%%
= 1 TO G.Device_Count
DeviceData
(I%%
).Buttons
= _LASTBUTTON(I%%
) ' number of buttons on the device DeviceData
(I%%
).Axis_p
= _LASTAXIS(I%%
) 'number of axis on the device IF G.Device_Count
< 3 THEN G.ControlType
= TRUE
'no joypads detected
SUB Display_BAD_Controller_Option
Result%% = TRUE
Result%% = FALSE
Result$ = "#ERROR#"
IF KeyCodes
(i~%%
).Value
= id&
THEN Result$
= KeyCodes
(i~%%
).Nam: i~%%
= 135 IF i~%%
= 134 THEN Result$
= "Unknown#" ControlName = Result$
FUNCTION AxisPower%%
(CJR%%
, CJL%%
, CJU%%
, CJD%%
) CJR%%
= _AXIS(C.Joy_Right
) CJL%%
= _AXIS(C.Joy_Left
) CJD%%
= _AXIS(C.Joy_Down
) IF CJR%%
= C.Joy_Right_Val
THEN CJL%%
= 0: CJR%%
= TRUE
ELSE CJR%%
= 0 IF CJD%%
= C.Joy_Down_Val
THEN CJU%%
= 0: CJD%%
= TRUE
ELSE CJD%%
= 0 AxisPower = nul%%
Ver~& = CurrentVer
' PUT #CF, , G.TextClick
' PUT #CF, , G.SkipIntro
GET #1, , c~%%
'retrieve number of files FOffset&(I~%%) = FOffset&(I~%%) + 1
Layer(7) = LoadGFX(FOffset(1), Size(1)) '_LOADIMAGE("overworldtiles.bmp", 32)
Layer(9) = LoadGFX(FOffset(2), Size(2)) '_LOADIMAGE("TitleScreen.bmp", 32)
Layer(10) = LoadGFX(FOffset(3), Size(3)) '_LOADIMAGE("Titlefalls.bmp", 32)
Layer(11) = LoadGFX(FOffset(4), Size(4)) '_LOADIMAGE("Titlescroll.bmp", 32)
Layer(12) = LoadGFX(FOffset(5), Size(5)) '_LOADIMAGE("selectionscreen.bmp", 32)
Layer(18) = LoadGFX(FOffset(13), Size(13)) '_LOADIMAGE("gfx\png\controller.png", 32)
Layer(17) = LoadGFX(FOffset(14), Size(14)) '_LOADIMAGE("gfx\png\21189.png", 32)
SFX(0) = LoadSFX(FOffset(6), Size(6))
SFX(1) = LoadSFX(FOffset(7), Size(7))
SFX(2) = LoadSFX(FOffset(8), Size(8))
SFX(3) = LoadSFX(FOffset(9), Size(9))
BGM(0) = LoadSFX(FOffset(10), Size(10))
FFX(0) = LoadFFX(FOffset(11), Size(11), 16)
LoadData FOffset(12), Size(12)
FUNCTION LoadFFX&
(Foff&
, Size&
, Fize%%
) LoadFFX&
= _LOADFONT("temp.dat", Fize%%
, "monospace")
SUB LoadData
(Foff&
, Size&
)
ClearLayer Layer(16)
FOR I%%
= 1 TO 3 'load all 3 records ELSE 'file doesn't exist so make it. Reset_Record 1
Reset_Record 2
Reset_Record 3
Save_Records
_PUTIMAGE (140, 72)-STEP(511, 447), Layer
(12), Layer
(16), (1, 1)-STEP(255, 223) 'background IF RTRIM$(Nick
(I%%
)) <> "" THEN Place_Player_Record I%%
- 1, 0 IF Record_Count%%
= 0 THEN Selection%%
= 4 ELSE Selection%%
= 1 Selection%% = Find_First_Available(0, 1)
Link = Records(Selection%%)
Exitflag%% = TRUE
nul%% = Register(nul%%)
IF RTRIM$(Nick
(I%%
)) <> "" THEN Place_Player_Record I%%
- 1, 0 Elimination_Mode
nul%% = Register(nul%%) 'go straight to register mode after elimination
Options
Selection%% = Selection%% + 1
IF Selection%%
= 7 THEN Selection%%
= 1 Selection%% = Find_First_Available(0, Selection%%)
_PUTIMAGE (220, 242)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'Player 1 _PUTIMAGE (220, 290)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'Player 2 _PUTIMAGE (220, 338)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'Player 3 _PUTIMAGE (220, 394)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'register _PUTIMAGE (220, 426)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'Elimination _PUTIMAGE (220, 458)-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'Options
Result%% = Records%%
ClearLayer Layer(16)
ClearLayer Layer(1)
_PUTIMAGE (140, 72)-STEP(511, 447), Layer
(12), Layer
(16), (258, 1)-STEP(255, 223) 'background IF RTRIM$(Nick
(i%%
)) <> "" THEN Place_Player_Record i%%
- 1, 1 IF i%%
> 0 THEN Selection%%
= i%%
ELSE Selection%%
= 1 IF RTRIM$(Nick
(i%%
)) = "" THEN _PUTIMAGE (300, 154 + 48 * (i%%
- 1))-STEP(31, 31), Layer
(12), Layer
(16), (1, 230)-STEP(15, 15) 'Player 1 Link (green) Current_Letter%% = 1
Selection%% = Find_First_Available(1, 1)
_PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current selected Letter Ly% = Ly% - 1
Current_Letter%% = Current_Letter%% - 11
IF Current_Letter%%
< 0 THEN Current_Letter%%
= 44 - ABS(Current_Letter%%
) _PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current selected Letter Ly% = Ly% + 1
Current_Letter%% = Current_Letter%% + 11
IF Current_Letter%%
> 44 THEN Current_Letter%%
= Current_Letter%%
- 44 _PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current selected Letter Lx% = Lx% - 1
IF Lx%
= -1 THEN Lx%
= 10: Ly%
= Ly%
- 1:
IF Ly%
= -1 THEN Ly%
= 3 Current_Letter%% = Current_Letter%% - 1
IF Current_Letter%%
= 0 THEN Current_Letter%%
= 44 _PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current selected Letter Lx% = Lx% + 1
IF Lx%
= 11 THEN Lx%
= 0: Ly%
= Ly%
+ 1:
IF Ly%
= 4 THEN Ly%
= 0 Current_Letter%% = Current_Letter%% + 1
IF Current_Letter%%
= 45 THEN Current_Letter%%
= 1 IF Selection%%
<> 4 THEN 'only allow buttons if valid name entry selection _PUTIMAGE (364 + 16 * Length%%
, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current Nick Letter Names(Selection%% - 1, Length%%) = Letter(Current_Letter%%)
Length%% = Length%% + 1
IF Length%%
= 8 THEN Length%%
= 0 a$ = ""
IF ASC(Names
(j%%
, i%%
)) > 31 THEN a$
= a$
+ Names
(j%%
, i%%
) Nick(j%% + 1) = a$
ExitFlag%% = TRUE
CASE SELECT_BUTTON
'Change to different name or end registration _PUTIMAGE (364 + 16 * Length%%
, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current Nick Letter _PUTIMAGE (274, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'heart selection Selection%% = Selection%% + 1: Length%% = 0 'reset the name position when changing.
IF Selection%%
= 5 THEN Selection%%
= 1 Selection%% = Find_First_Available(1, Selection%%)
_PUTIMAGE (274, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'heart selection IF Names
(Selection%%
- 1, j%%
) > CHR$(31) THEN _PRINTSTRING (364 + 16 * j%%
, 152 + 48 * (Selection%%
- 1)), Names
(Selection%%
- 1, j%%
), Layer
(1) _PUTIMAGE (364 + 16 * Length%%
, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (61, 230)-STEP(7, 7) 'Current Nick Letter _PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (61, 230)-STEP(7, 7) 'Current selected Letter _PUTIMAGE (364 + 16 * Length%%
, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current Nick Letter _PUTIMAGE (236 + 32 * Lx%
, 328 + 32 * Ly%
)-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'Current selected Letter b%% = b%% + 1
IF b%%
= 8 THEN blink%%
= NOT blink%%: b%%
= 0 ClearLayer Layer(16)
Save_Records
IF RTRIM$(Nick
(i%%
)) <> "" THEN Place_Player_Record i%%
- 1, 0 Register = Result%%
ClearLayer Layer(16)
ClearLayer Layer(1)
_PUTIMAGE (140, 72)-STEP(511, 447), Layer
(12), Layer
(16), (515, 1)-STEP(255, 223) 'background IF RTRIM$(Nick
(i%%
)) <> "" THEN Place_Player_Record i%%
- 1, 1 IF i%%
> 0 THEN Selection%%
= i%%
ELSE Selection%%
= 1 FOR i%%
= 1 TO 3 'remove the erased game from the background screens IF RTRIM$(Nick
(i%%
)) = "" THEN _PUTIMAGE (300, 154 + 48 * (i%%
- 1))-STEP(31, 31), Layer
(12), Layer
(16), (1, 230)-STEP(15, 15) 'Player 1 Link (green) Current_Letter%% = 1
Selection%% = 1
Nick(Selection%%) = ""
Reset_Record Selection%%
_PUTIMAGE (364, 152 + 48 * (Selection%%
- 1))-STEP(159, 31), Layer
(12), Layer
(16), (86, 240)-STEP(7, 7) 'black out _PUTIMAGE (236, 232 + 48 * (Selection%%
- 1))-STEP(159, 33), Layer
(12), Tmp&
, (86, 240)-STEP(7, 7) 'black out name _PUTIMAGE (428, 232 + 48 * (Selection%%
- 1))-STEP(127, 31), Layer
(12), Tmp&
, (86, 240)-STEP(7, 7) 'black out hearts ExitFlag%% = TRUE
_PUTIMAGE (274, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'heart selection black out Selection%% = Selection%% + 1
IF Selection%%
= 5 THEN Selection%%
= 1 _PUTIMAGE (274, 152 + 48 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (73, 267)-STEP(7, 7) 'heart selection ClearLayer Layer(16)
SUB Reset_Record
(Which%%
) Records(Which%%) = Reset_Link
Selection%% = 1
MSTR = G.MSTR_Vol / 100
BGMV = G.BGM_vol / 100
SFXV = G.SFX_Vol / 100
ClearLayer Layer(16)
ClearLayer Layer(1)
_PUTIMAGE (140, 72)-STEP(511, 447), Layer
(12), Layer
(16), (772, 1)-STEP(255, 223) 'background
Custom_Controls
ExitFlag%% = TRUE
_PUTIMAGE (112, 352 + 32 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (86, 240)-STEP(7, 7) 'heart selection black out Selection%% = Selection%% + 1
IF Selection%%
= 3 THEN Selection%%
= 1
IF Locked%%
= 0 THEN 'player just clicked mouse IF X%
> 359 AND X%
< 617 THEN 'mouse is in the volume slider area IF y%
> 143 AND y%
< 160 THEN Locked%%
= 1 'master volume slider selected IF y%
> 175 AND y%
< 192 THEN Locked%%
= 2 'Music volume slider selected IF y%
> 207 AND y%
< 224 THEN Locked%%
= 3 'Sounds volume slider selected IF y%
> 255 AND y%
< 272 THEN Locked%%
= 4 'Scale slider selected ELSE 'player has a selected volume slider IF X%
> 359 AND X%
< 617 THEN 'mouse is in the volume slider area NewVol! = (X% - 359) / 256
CASE 1 'set new master volume MSTR = NewVol!
CASE 2 'set new Music volume BGMV = NewVol!
CASE 3 'set new sounds volume SFXV = NewVol!
G.Scale_Factor = 1
G.Scale_Factor = 2
G.Scale_Factor = 3
ELSEIF Locked%%
THEN 'player released the mouse button Locked%% = FALSE
Update_Volume_Bars MSTR, BGMV, SFXV
_PUTIMAGE (112, 352 + 32 * (Selection%%
- 1))-STEP(15, 15), Layer
(12), Layer
(1), (73, 247)-STEP(7, 7) 'heart selection '------Make the changes final-----
G.MSTR_Vol
= INT(MSTR
* 100) G.BGM_vol
= INT(BGMV
* MSTR
* 100) G.SFX_Vol
= INT(SFXV
* MSTR
* 100) G.Scale_X = 16 * G.Scale_Factor - 1
G.Scale_Y = 16 * G.Scale_Factor - 1
Link.Screen_X = Offset_X(G.Scale_Factor) + (16 * G.Scale_Factor * 7) + 8 * G.Scale_Factor '392
Link.Screen_Y = Offset_Y(G.Scale_Factor) + (16 * G.Scale_Factor * 5) '292
'---------------------------------
ClearLayer Layer(16)
SUB Update_Volume_Bars
(M!
, B!
, S!
) LINE (360, 176)-STEP(16 * 16, 16), _RGB32(0 + INT(255 * (B!
* M!
)), 255 - INT(255 * (B!
* M!
)), 0), BF
LINE (360, 208)-STEP(16 * 16, 16), _RGB32(0 + INT(255 * (S!
* M!
)), 255 - INT(255 * (S!
* M!
)), 0), BF
LINE (360, 256)-STEP(16 * 16, 16), _RGB32(0 + 128 * (G.Scale_Factor
- 1), 255 - 128 * (G.Scale_Factor
- 1), 0), BF
LINE (360 + 128 * (G.Scale_Factor
- 1), 256)-STEP(1, 20), _RGB32(224, 224, 224), B