Computer Science Canada

Zelda

Author:  Legolas [ Sun Jan 23, 2005 10:08 pm ]
Post subject:  Zelda

This is just the starting of a recreation of the old Zelda game: Links Awakening. Its not finished yet, and the AI still has some glitches in it so I didn't include it. Alt - A button, Ctrl- B button, Enter/Return - Start button, Arrow keys - movement.

Author:  zomg [ Sun Jan 23, 2005 10:14 pm ]
Post subject: 

whoa! Shocked thats amazing... but uh isnt that copyright infringment lol Laughing

Author:  Bacchus [ Mon Jan 24, 2005 7:14 am ]
Post subject: 

woah thats nice, cant wait till its done Smile

Author:  Viper [ Mon Jan 24, 2005 9:21 am ]
Post subject: 

can u post it as a .zip plz

Author:  Andy [ Mon Jan 24, 2005 4:34 pm ]
Post subject: 

wow.. that is very well done.. although.. if u press down ctrl and alt at the same time, the program crashes.. i also recommend you use x and z instead of ctrl and alt just because its more standard.. when you hold down the sword, it shouldnt keep slashing, and also you should be able to chop grass.. you must've put in alot of effort, please keep us updated on your progres.. +50 bits

Author:  Mr. T [ Mon Jan 24, 2005 4:57 pm ]
Post subject: 

Damn, those are some sick uber hacks!!!

Author:  cycro1234 [ Mon Jan 24, 2005 7:45 pm ]
Post subject: 

AWSOME DUDE!! I LOVE ZELDA! Super 1337!

Author:  Mazer [ Mon Jan 24, 2005 10:09 pm ]
Post subject: 

I'd like to see this, but I'm running Linux now and don't have time to download an emulator... could you put up a screenshot or two somewhere and then link to them?

Author:  Viper [ Tue Jan 25, 2005 9:23 am ]
Post subject: 

how many line is it .............n when it gonna be done i wanna play Very Happy Very Happy

Author:  MiX-MaztA-M8riX [ Tue Jan 25, 2005 11:27 am ]
Post subject: 

Damn, Cant download files at school Sad

Not even supposed to be on forums Neutral

I'll D-L it at my dads this weekend and by some other replies alraedy, sounds '1337' lol Laughing

Author:  [Gandalf] [ Tue Jan 25, 2005 6:56 pm ]
Post subject: 

How is that a hack? Very nice game, probably best (or tied for) rpg start I have ever seen on turing.

A few suggestions:
1. When you exit and reenter a screen the grass respawns.
2. When you are near an object you cant change direction. (to face the object)
3. Make buildings enterable! Very Happy

Can't wait till you're done!

Author:  Unreal_Origin [ Tue Jan 25, 2005 7:59 pm ]
Post subject:  Amazing job

wow i was truely impress and i can't wait for the rest,

one question how many lines is that?

Author:  Legolas [ Tue Jan 25, 2005 8:50 pm ]
Post subject: 

The game is about 800 lines of code including the declaring of all the pictures.

Gandalf - From the Zelda games, when you leave the screen and return, the grass is meant to respawn, not stay cut. The change direction bug is also known to me, but haven't reajusted the collision detection to take that into effect yet.

Author:  Unreal_Origin [ Tue Jan 25, 2005 9:25 pm ]
Post subject:  I found a bug

hey when you start, go left 2 sreens, down 2 screens right one screen, down one screen, then go off the jump to the next screen and you get stuck inside a bush,

anyhoo i am still very impressed

Author:  Viper [ Wed Jan 26, 2005 8:57 am ]
Post subject: 

wow it sounds like u were trying to find a glitch or was it jus chance u found it Confused Confused

Author:  Mazer [ Wed Jan 26, 2005 9:30 am ]
Post subject: 

Just checked it out from the school computers (I still think people should post screenshots).
Very well done, I'm impressed. I don't have a seal of approval to give you but once I can be bothered to make one, you'll receive yours.

Author:  Drakain Zeil [ Wed Jan 26, 2005 12:51 pm ]
Post subject: 

It sounds cool, I'll download it when I'm on windows again.

Author:  Catalyst [ Wed Jan 26, 2005 10:52 pm ]
Post subject: 

awesome Very Happy

Author:  basketball4ever [ Wed Jan 26, 2005 11:12 pm ]
Post subject: 

very nice, though slow Smile very nice. cant wait to play zelda with turing when ur done Very Happy

Author:  [Gandalf] [ Thu Jan 27, 2005 1:40 am ]
Post subject: 

The slowness problem is probably with your pc. Turing games seem to require much more cpu and stuff than then should...

Author:  AsianSensation [ Thu Jan 27, 2005 6:03 pm ]
Post subject: 

yep, yep, alot of effort, pretty smooth too. ++bits.

Author:  Jonny Tight Lips [ Thu Feb 03, 2005 7:40 pm ]
Post subject: 

wow that is amazing! And only 800 lines!!! wow, could you post the sorce for that. I want to know how you did the walking and the back ground? did you use a tile system? Did you use sprites? AMAZING GAME!

Author:  apomb [ Fri Feb 04, 2005 3:22 am ]
Post subject: 

all you need to do is make it a .nes file and hope you dont get caught for, lke it has been stated, copyright infringenment ... great job tho! 8)

Author:  TheZsterBunny [ Fri Feb 04, 2005 5:56 am ]
Post subject: 

Very nice ^_^

one complaint however- no diagonal movement!

If you hold up and left, you'll move up. if you hold attack, you constantly attack. :S

=Z

Author:  zomg [ Fri Feb 04, 2005 8:08 am ]
Post subject: 

TheZsterBunny wrote:
Very nice ^_^

one complaint however- no diagonal movement!

If you hold up and left, you'll move up. if you hold attack, you constantly attack. :S

=Z


there wasnt diagonal movements in the gameboy either

suggestion:if u hold down sword it should do that power up spining thing

Author:  Flikerator [ Fri Feb 04, 2005 12:10 pm ]
Post subject: 

Wow im really impressed Very Happy

When shall we see an update? ^^

Author:  mike200015 [ Sat Feb 05, 2005 11:27 am ]
Post subject: 

wow thats amazing.. very nice.. i also checked out that glitch where u get stuck in the bush, but besides that its amazing!! cant wait for it to be done

Author:  ssr [ Sat Feb 05, 2005 6:40 pm ]
Post subject: 

I LOVE THIS GAME
man u must have put so much effort in tot eh game
hey u should sell it after u r done Very Happy $50 each
but share it here for free
lol

Author:  Jonny Tight Lips [ Tue Feb 15, 2005 9:52 pm ]
Post subject: 

I was wondering if it would be ok if I used your tiles? There the perfect size and just what I need. Just wanted make sure its ok with you. Don't wanna make anyone mad. Hope you don't mind. Very nice game. I would still like to see the sorce code for it.

Author:  illu45 [ Sun Mar 06, 2005 11:50 am ]
Post subject: 

Wow.. that's simply awesome... Very nice wrok, can't wait for more

Author:  djlenny_3000 [ Mon Mar 07, 2005 11:18 am ]
Post subject: 

MOST AMAZING THING IN TURING EVER only 1 thing i am drooling over, i want enemies

Author:  [Gandalf] [ Mon Mar 07, 2005 5:09 pm ]
Post subject: 

I'm not sure we're getting an update... It's been a long while since this was posted. I would love to see an update - at least release the source code if you're not working on it anymore...

Author:  person [ Mon Mar 07, 2005 5:22 pm ]
Post subject: 

ever notice that no one really finishes their games?? (at least not the ones they submit)

Author:  Flikerator [ Mon Mar 07, 2005 8:23 pm ]
Post subject: 

person wrote:
ever notice that no one really finishes their games?? (at least not the ones they submit)


Im still finishing my Zombie Game Rolling Eyes (Put on hold due to competition).

Author:  Bacchus [ Mon Mar 07, 2005 8:32 pm ]
Post subject: 

i usually finish mine unless they hit a bug that im to lazy to fix or have a brain fart, then their put on hold until further notice Razz

Author:  Flikerator [ Mon Mar 07, 2005 8:40 pm ]
Post subject: 

Bacchus wrote:
i usually finish mine unless they hit a bug that im to lazy to fix or have a brain fart, then their put on hold until further notice Razz


Whats the bestest biggest codiest game you made?

EDIT

and finished Wink

Author:  Bacchus [ Mon Mar 07, 2005 9:08 pm ]
Post subject: 

hm.. im not exacly sure, the biggest code ive written (and finished) would have probably been bomberman. the largest code ive written was pacman just cause i had variables for every single dot that he can eat lol which was +100 lines by itself but i never finished that lol. then again its not the size that matters, its how you use it Razz

Author:  person [ Mon Mar 07, 2005 9:38 pm ]
Post subject: 

LOL Bacchus

the longest code iv ever made was 750 lines long...(horse racing ISP)

Author:  Bacchus [ Mon Mar 07, 2005 9:56 pm ]
Post subject: 

ya pretty sure pac-mands my longest, 902 lines long (not even done) and 344 of those lines are just setting the dot variables lol, should have just used a txt file

Author:  [Gandalf] [ Tue Mar 08, 2005 5:07 pm ]
Post subject: 

My longest is 415 lines, but 40 or 50% of it is text.

Actually, now that I look at it - my longest is 436 lines (cheap asteroids).

Author:  Token [ Tue Mar 08, 2005 8:39 pm ]
Post subject: 

wow, that is really amazing, i cant wait to see when it is compleated! keep up the good work man

Author:  Mazer [ Tue Mar 08, 2005 9:06 pm ]
Post subject: 

person wrote:
ever notice that no one really finishes their games?? (at least not the ones they submit)

In my day, we used to finish our games, submit them, and continue working on them until we die and become the subject of Legends. Many songs were made to tell our stories, but those are all but forgotten now.

Author:  Bacchus [ Tue Mar 08, 2005 9:10 pm ]
Post subject: 

like wat then? id like to try those games lol. meh im not that good at making games, im not creative. im better at utilities and such to either enhance scripting for certain things or just to fool around lol

Author:  person [ Wed Mar 09, 2005 4:23 pm ]
Post subject: 

im only good aat answering questions that have an input/output thing...nothing too creative and fooling around is just boring for me because i cant think of any random things to make or...(continues saying pointless things)...

Author:  [Gandalf] [ Wed Mar 09, 2005 5:08 pm ]
Post subject: 

Just do what I did for one of my long programs. Learn, type what you learn, learn some more, type some more of that, and so on to infinity Very Happy - something good will come out of it eventually Smile .

Again, I am beggining to seriously doubt that this game will ever be updated. Actually, how about we put a bet on that - anyone? The person that loses has to make a game. That game won't be finished, and then we will bet on that, and the cycle will continue!

Congrats if you understood that Confused Claping - you prize: you have to make a game (which in turn won't be finished, and we will then..........) lol, what a crazy post of mine.

Author:  Artimes [ Fri Apr 01, 2005 11:13 pm ]
Post subject: 

I think what you did was kind of similar to my Pac-Man game. A simple algorythm reads a file with a series of numbers. Each number represents a tile type.

So in your file you would have for example;

1111
10001
10001
10001
1111

0 represents an empty space, and 1 represents a brick for example.

The program reads the text file and places a picture(tile) depending on the the number in the text file on the grid. It would generaly start in the top left corner, work to the right, then goto the next row. Therefore it's easy to make a map using tiles and a text file.

You can also have an array for these like "passable (i)", where i is the tile number and the array can be a boolean, true or false.

You would then using a function find out what tile your sprit is situated on, his direction, and then check the tile infront of him, that tile's "passalbility" and then decide whether you can move forward or not...

*takes deep breath*

That's just the jist of it. I also noticed the map files can be opened in notepad and as I said, just a bunch of numbers. Wink

Author:  jamonathin [ Sat Apr 02, 2005 3:37 pm ]
Post subject: 

Hey thats a pretty cool idea Artimes 8)

Author:  Jonny Tight Lips [ Sun Apr 03, 2005 9:26 pm ]
Post subject: 

I would still like to see the sorce code.

Author:  Flikerator [ Mon Apr 04, 2005 10:45 am ]
Post subject: 

Jonny Tight Lips wrote:
I would still like to see the sorce code.


Wouldn't we all...We should raise a big mass of bits ^^;

Author:  jamonathin [ Tue Apr 05, 2005 8:04 am ]
Post subject: 

Pretty good game[ i finally took the time to dl it at school]. I'm curious of how he made the restrictions, like if he programmed every co-ordinate (prob. not) or if he used whatdotcolor in a seperate picture no one else can see. A problem he's going to have down the road is when he puts in the AI. The graphics look good so far, but the AI and everything else will get messed up because of his delay's. The program is only set up for 1 player/character, and his delays for his character are going to interfere with everything else, like it already does (swing sword and look at flowers).

I wish i could find a good place for maps, this is the only site i have, that has good sprites for the most part http://www.nes-snes-sprites.com/

Anyone know where to find map sprites? Confused

Author:  Artimes [ Wed Apr 06, 2005 7:14 pm ]
Post subject: 

Look up RPG Maker 2000/2003/XP, tonnes of maps and character sets.

Author:  jamonathin [ Wed Apr 06, 2005 8:20 pm ]
Post subject: 

Aiight, sounds good mayte! Flaming

Author:  Palindine [ Thu Apr 07, 2005 3:30 am ]
Post subject: 

well i'd definately give this guy bits if i had more then i did, he was able to do more then i ever could with a zelda game, lord knows i've started about 5 different times and kept running into problems. and as to my largest prog writen was around 1 to 3 thousand lines or something like that, i had them posted up here for a while, "Team L337" prog's, they were for a contest.

Author:  barneyoncrack [ Mon Apr 11, 2005 5:21 pm ]
Post subject: 

Shocked [/code]

Author:  jamonathin [ Tue Apr 12, 2005 8:49 am ]
Post subject: 

barneyoncrack wrote:
Shocked [/code]

What's that? It doesn't even relate to any of the topics. Don't juss put meaningless emocotions on random topics to earn yourself bits and posts, you may make someone [a mod] a little annoyed with you.

Author:  RscMod [ Thu Apr 14, 2005 10:38 am ]
Post subject: 

yep its cool

Author:  Legolas [ Wed Apr 20, 2005 8:30 pm ]
Post subject: 

I finally got around to posting the actual coding of the program. The new one is gone because i had computer problems, so you will have to settle for the older code, which is not as nice, nor as easy to read. I cut out all the picture declerations to save space. First all the procedures and declerations:

code:

type menu :
    record
        picture : int
        item : int
    end record

var pic : array 1 .. 133 of int
var console : array 1 .. 7 of int
var playerpics : array 1 .. 27 of int
var positioning : array 1 .. 6, 1 .. 2 of menu
var watercounter, flowercounter, movementcounter, tempa, tempb, player, weaponmovementcounter, health, healthtotal, shieldmove : int
var swinging : array 1 .. 16 of int

shieldmove := 0
health := 6
healthtotal := 3
for x : 1 .. 6
    for y : 1 .. 2
        positioning (x, y).item := 0
        positioning (x, y).picture := Pic.FileNew ("Pictures/Console/Start Menu/Empty1.bmp")
    end for
end for
positioning (1, 1).picture := Pic.FileNew ("Pictures/Console/Start Menu/Shield1.bmp")
positioning (1, 1).item := 1
positioning (1, 2).item := 2
positioning (1, 2).picture := Pic.FileNew ("Pictures/Console/Start Menu/Sword.bmp")

watercounter := 0
flowercounter := 0
movementcounter := 0


procedure movement (var current, num1, num2 : int)
    if current ~= num1 and current ~= num2 then
        current := num1
        lastpicture := num1
    end if
    if movementcounter > 10 then
        if current = num1 then
            current := num2
            lastpicture := num2
        elsif player = num2 then
            current := num1
            lastpicture := num1
        end if
    end if
    if movementcounter > 10 then
        movementcounter := 0
    end if
end movement

procedure drawbackground
    Draw.FillBox (0, 0, 500, 500, white)
    j := 256
    for x : 1 .. 8
        i := 0
        for y : 1 .. 10
            if watercounter > 30 then
                if background (x, y) = 77 then
                    background (x, y) := 78
                elsif background (x, y) = 78 then
                    background (x, y) := 79
                elsif background (x, y) = 79 then
                    background (x, y) := 77
                end if
                if background (x, y) = 116 then
                    background (x, y) := 117
                elsif background (x, y) = 117 then
                    background (x, y) := 118
                elsif background (x, y) = 118 then
                    background (x, y) := 119
                elsif background (x, y) = 119 then
                    background (x, y) := 116
                end if
                if background (x, y) = 120 then
                    background (x, y) := 121
                elsif background (x, y) = 121 then
                    background (x, y) := 122
                elsif background (x, y) = 122 then
                    background (x, y) := 123
                elsif background (x, y) = 123 then
                    background (x, y) := 120
                end if
            end if
            if flowercounter > 20 then
                if background (x, y) = 36 then
                    background (x, y) := 102
                elsif background (x, y) = 102 then
                    background (x, y) := 103
                elsif background (x, y) = 103 then
                    background (x, y) := 128
                elsif background (x, y) = 128 then
                    background (x, y) := 36
                end if
            end if
            Pic.Draw (pic (background (x, y)), i, j, picCopy)
            i += 32
        end for
        j -= 32
    end for
    if watercounter > 30 then
        watercounter := 0
    else
        watercounter += 1
    end if
    if flowercounter > 20 then
        flowercounter := 0
    else
        flowercounter += 1
    end if
end drawbackground


procedure barrier
    j := 256
    for x : 1 .. 8
        i := 0
        for y : 1 .. 10
            if background (x, y) = 13 or background (x, y) = 14 or background (x, y) = 30 or background (x, y) = 31 or background (x, y) = 32 or background (x, y) = 51 or
                    background (x, y) = 52 or background (x, y) = 61 or background (x, y) = 62 or background (x, y) = 63 or background (x, y) = 64 or background (x, y) = 65 or
                    background (x, y) = 66 or background (x, y) = 67 or background (x, y) = 68 or background (x, y) = 69 or background (x, y) = 70 or background (x, y) = 71
                    or background (x, y) = 74 or background (x, y) = 75 or background (x, y) = 15 or background (x, y) = 16 or background (x, y) = 17 or background (x, y) = 106
                    or background (x, y) = 22 or background (x, y) = 23 or background (x, y) = 24 or background (x, y) = 25 or background (x, y) = 26 or background (x, y) = 27
                    or background (x, y) = 28 or background (x, y) = 29 or background (x, y) = 37 or background (x, y) = 38 or background (x, y) = 40 or background (x, y) = 41
                    or background (x, y) = 43 or background (x, y) = 44 or background (x, y) = 45 or background (x, y) = 46 or background (x, y) = 47 or background (x, y) = 48
                    or background (x, y) = 49 or background (x, y) = 53 or background (x, y) = 54 or background (x, y) = 55 or background (x, y) = 56 or background (x, y) = 57
                    or background (x, y) = 58 or background (x, y) = 73 or background (x, y) = 76 or background (x, y) = 18 or background (x, y) = 19 or background (x, y) = 20
                    or background (x, y) = 21 or background (x, y) = 59 or background (x, y) = 60 or background (x, y) = 80 or background (x, y) = 81 or background (x, y) = 82
                    or background (x, y) = 83 or background (x, y) = 84 or background (x, y) = 85 or background (x, y) = 86 or background (x, y) = 87 or background (x, y) = 88
                    or background (x, y) = 89 or background (x, y) = 90 or background (x, y) = 91 or background (x, y) = 92 or background (x, y) = 94 or background (x, y) = 108
                    or background (x, y) = 96 or background (x, y) = 96 or background (x, y) = 99 or background (x, y) = 100 or background (x, y) = 101 or background (x, y) = 107
                    or background (x, y) = 98 or background (x, y) = 109 or background (x, y) = 104 or background (x, y) = 114 or background (x, y) = 115 or background (x, y) = 113
                    or background (x, y) = 112 or background (x, y) = 120 or background (x, y) = 121 or background (x, y) = 122 or background (x, y) = 123 or background (x, y) = 124
                    or background (x, y) = 127 then
                Draw.FillBox (i, j, i + 32, j + 32, 245)
            end if
            if background (x, y) = 14 or background (x, y) = 104 then
                Draw.FillBox (i, j, i + 32, j + 32, 230)
            end if
            if background (x, y) = 42 then
                Draw.FillBox (i + 16, j, i + 32, j + 32, 245)
            end if
            if background (x, y) = 72 or background (x, y) = 93 then
                Draw.FillBox (i, j, i + 32, j + 16, 240)
            end if
            if background (x, y) = 95 then
                if y ~= 10 then
                    if background (x, y + 1) = 95 then
                        Draw.FillBox (i + 8, j + 8, i + 32, j + 24, 235)
                    end if
                else
                    Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
                end if
                if y ~= 1 then
                    if background (x, y - 1) = 95 then
                        Draw.FillBox (i, j + 8, i + 32, j + 24, 235)
                    else
                        Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
                    end if
                end if
            end if
            i += 32
        end for
        j -= 32
    end for
end barrier

procedure receivebackgroundinfo
    file := "Levels/" + intstr (choice) + ".dat"
    open : input, file, get
    for x : 1 .. 8
        for y : 1 .. 10
            get : input, background (x, y)
        end for
    end for
end receivebackgroundinfo

procedure recievesecondaryinfo
    file := "Levels/" + intstr (choice) + ".dat"
    open : input, file, get
    for x : 1 .. 8
        for y : 1 .. 10
            get : input, secondary (x, y)
        end for
    end for
    close (input)
end recievesecondaryinfo

procedure drawconsole
    var displayfull, outputx : int
    Pic.Draw (console (1), 0, 0, picCopy)
    Pic.Draw (positioning (1, 1).picture, 16, 4, picMerge)
    Pic.Draw (positioning (1, 2).picture, 96, 4, picMerge)
    displayfull := health div 2
    outputx := 210
    for b : 1 .. healthtotal
        if b <= displayfull then
            Pic.Draw (console (7), outputx, 20, picMerge)
        elsif health mod 2 = 1 and b = displayfull + 1 then
            Pic.Draw (console (6), outputx, 20, picMerge)
        else
            Pic.Draw (console (5), outputx, 20, picMerge)
        end if
        outputx += 15
    end for
end drawconsole

procedure switch

end switch
procedure switchright
    for m : 1 .. 40
        j := 256
        for x : 1 .. 8
            i := 0 - (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 256
        for x : 1 .. 8
            i := 320 - (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchright
procedure switchleft
    for m : 1 .. 40
        j := 256
        for x : 1 .. 8
            i := 0 + (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 256
        for x : 1 .. 8
            i := -320 + (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchleft

procedure switchup
    for m : 1 .. 32
        j := 256 - (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 508 - (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchup

procedure switchdown
    for m : 1 .. 32
        j := 256 + (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 6 + (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchdown


procedure secondarytoback
    for x : 1 .. 8
        for y : 1 .. 10
            background (x, y) := secondary (x, y)
        end for
    end for
end secondarytoback


procedure ledgefalling
    var flippingpics : int := 0
    if whatdotcolour (playerx + 40, playery + 30) = 240 then
        player := 21
        loop
            barrier
            playery -= 3
            if playery >= 228 then
                choice := choice + 16
                recievesecondaryinfo
                switchup
                playery := 2
                secondarytoback
                barrier
            end if
            if playery <= 2 then
                choice := choice - 16
                recievesecondaryinfo
                switchdown
                playery := 228
                secondarytoback
                barrier
            end if
            exit when whatdotcolour (playerx + 40, playery + 30) ~= 240 and whatdotcolour (playerx + 40, playery + 60) ~= 245 and whatdotcolour (playerx + 40, playery + 35) ~= 240 and
                whatdotcolour (playerx + 40, playery + 30) ~= 245

            if flippingpics > 10 then
                if player = 21 then
                    player := 22
                elsif player = 22 then
                    player := 23
                else
                    player := 1
                end if
            end if
            if flippingpics > 10 then
                flippingpics := 0
            else
                flippingpics += 1
            end if
            drawbackground
            Pic.Draw (playerpics (player), playerx, playery, picMerge)
            View.Update
            delay (7)
        end loop
    end if
end ledgefalling

procedure beinghurt
    health -= 1
    if health <= 0 then
        player := 1
        for x : 1 .. 14
            cls
            Pic.Draw (playerpics (player), playerx, playery, picMerge)
            delay (200)
            View.Update
            if player = 4 then
                player := 1
            else
                player += 1
            end if
        end for
        cls
        Pic.Draw (playerpics (20), playerx, playery, picMerge)
        View.Update
        delay (700)
        choice := deathchoice
        playerx := savepointx
        playery := savepointy
        health := 6
        recievesecondaryinfo
        secondarytoback
        temp := choice
    else
        if player = 1 or player = 5 then
            player := 1
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 1 then
                    player := 16
                else
                    player := 1
                end if
                delay (40)
            end for
            player := 1
        elsif player = 2 or player = 6 then
            player := 2
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 2 then
                    player := 17
                else
                    player := 2
                end if
                delay (40)
            end for
            player := 2
        elsif player = 3 or player = 7 then
            player := 3
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 3 then
                    player := 18
                else
                    player := 3
                end if
                delay (40)
            end for
            player := 3
        elsif player = 4 or player = 8 then
            player := 4
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 4 then
                    player := 19
                else
                    player := 4
                end if
                delay (40)
            end for
            player := 4
        end if
    end if
end beinghurt

procedure holefall
    if whatdotcolour (playerx + 45, playery + 40) = 235 then
        for l : 13 .. 15
            drawbackground
            drawconsole
            Pic.Draw (playerpics (l), playerx, playery, picMerge)
            View.Update
            delay (200)
        end for
        if health > 1 then
            playerx := deathpointx
            playery := deathpointy
        end if
        beinghurt
    end if
end holefall
procedure startmenu
    var choosex, choosey, currentarray1, currentarray2, x1, y1, temp : int
    choosex := 12
    choosey := 210
    drawbackground
    currentarray1 := 2
    currentarray2 := 1
    for x : 1 .. 256 by 3
        drawbackground
        Pic.Draw (console (4), 0, -256 + x, picCopy)
        View.Update
    end for
    delay (20)
    cls
    loop
        Input.KeyDown (press)
        Draw.FillBox (0, 0, 500, 500, white)
        Pic.Draw (console (3), 0, 0, picCopy)
        Pic.Draw (console (2), choosex, choosey, picMerge)
        Pic.Draw (positioning (1, 1).picture, 16, 256, picMerge)
        Pic.Draw (positioning (1, 2).picture, 96, 256, picMerge)
        if press (KEY_UP_ARROW) then
            if currentarray1 > 2 then
                choosey := choosey + 50
                currentarray1 := currentarray1 - 1
            end if
        end if
        if press (KEY_DOWN_ARROW) then
            if currentarray1 < 6 then
                choosey := choosey - 50
                currentarray1 := currentarray1 + 1
            end if
        end if
        if press (KEY_RIGHT_ARROW) then
            if currentarray2 = 1 then
                choosex := choosex + 63
                currentarray2 := currentarray2 + 1
            end if
        end if
        if press (KEY_LEFT_ARROW) then
            if currentarray2 = 2 then
                choosex := choosex - 63
                currentarray2 := currentarray2 - 1
            end if
        end if
        if press (KEY_CTRL) then
            temp := positioning (currentarray1, currentarray2).picture
            positioning (currentarray1, currentarray2).picture := positioning (1, 1).picture
            positioning (1, 1).picture := temp
            temp := positioning (currentarray1, currentarray2).item
            positioning (currentarray1, currentarray2).item := positioning (1, 1).item
            positioning (1, 1).item := temp
            delay (100)
        end if
        if press (KEY_ALT) then
            temp := positioning (currentarray1, currentarray2).picture
            positioning (currentarray1, currentarray2).picture := positioning (1, 2).picture
            positioning (1, 2).picture := temp
            temp := positioning (currentarray1, currentarray2).item
            positioning (currentarray1, currentarray2).item := positioning (1, 2).item
            positioning (1, 2).item := temp
            delay (100)
        end if
        exit when press (KEY_ENTER)
        x1 := 12
        y1 := 260
        for i : 2 .. 6
            y1 -= 50
            x1 := 12
            for j : 1 .. 2
                Pic.Draw (positioning (i, j).picture, x1, y1, picMerge)
                x1 += 63
            end for
        end for
        View.Update
        delay (80)
    end loop
    for x : 1 .. 256 by 3
        drawbackground
        Pic.Draw (console (4), 0, 0 - x, picCopy)
        Pic.Draw (positioning (1, 1).picture, 12, 258 - x, picMerge)
        Pic.Draw (positioning (1, 2).picture, 92, 258 - x, picMerge)
        View.Update
    end for
end startmenu

weaponmovementcounter := 0

procedure buttonpresses (var current, whichbutton : int)
    var number1, number2, bushslash, changepicx, changepicy : int
    if positioning (1, whichbutton).item = 1 then
        shieldmove := 1
    elsif positioning (1, whichbutton).item = 2 then
        barrier
        if current = 1 or current = 5 then
            number1 := 1
            number2 := 4
            if whatdotcolor (playerx + 53, playery + 12) = 230 then
                bushslash := 1
            else
                bushslash := 0
            end if
            if whatdotcolor (playerx + 53, playery + 12) = 230 or whatdotcolor (playerx + 53, playery + 17) = 230 or whatdotcolor (playerx + 53, playery + 23) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if playerx + 53 >= i and playerx + 53 <= i + 32 and ((playery + 12 >= j - 32 and playery + 12 <= j) or (playery + 17 >= j - 32 and playery + 17 <= j) or (playery + 23 >= j -
                                32 and playery + 23 <= j)) then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 2 or current = 6 then
            number1 := 5
            number2 := 8
            if whatdotcolor (playerx + 75, playery + 37) = 230 or whatdotcolor (playerx + 70, playery + 37) = 230 or whatdotcolor (playerx + 65, playery + 37) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if ((playerx + 75 >= i and playerx + 75 <= i + 32) or (playerx + 70 >= i and playerx + 70 <= i + 32) or (playerx + 65 >= i and playerx + 65 <= i + 32)) and playery + 37 >= j -
                                32 and playery + 37 <= j then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 3 or current = 7 then
            number1 := 9
            number2 := 12
            if whatdotcolor (playerx + 36, playery + 80) = 230 or whatdotcolor (playerx + 36, playery + 75) = 230 or whatdotcolor (playerx + 36, playery + 70) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if playerx + 36 >= i and playerx + 36 <= i + 32 and ((playery + 80 >= j - 32 and playery + 80 <= j) or (playery + 75 >= j - 32 and playery + 75 <= j) or (playery + 70 >= j -
                                32 and playery + 70 <= j)) then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 4 or current = 8 then
            number1 := 13
            number2 := 16
            if whatdotcolor (playerx + 10, playery + 37) = 230 or whatdotcolor (playerx + 15, playery + 37) = 230 or whatdotcolor (playerx + 20, playery + 37) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if ((playerx + 10 >= i and playerx + 10 <= i + 32) or (playerx + 15 >= i and playerx + 15 <= i + 32) or (playerx + 20 >= i and playerx + 20 <= i + 32)) and playery + 37 >= j -
                                32 and playery + 37 <= j then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if bushslash = 1 and background (changepicx, changepicy) = 14 then
            background (changepicx, changepicy) := 50
            secondary (changepicx, changepicy) := 50
        elsif bushslash = 1 and background (changepicx, changepicy) = 104 then
            background (changepicx, changepicy) := 105
            secondary (changepicx, changepicy) := 105
        end if
        for l : number1 .. number2
            drawbackground
            drawconsole
            if bushslash = 1 then
                if l = number1 then
                    Pic.Draw (pic (130), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 1 then
                    Pic.Draw (pic (131), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 2 then
                    Pic.Draw (pic (132), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 3 then
                    Pic.Draw (pic (133), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                end if
            end if
            Pic.Draw (swinging (l), playerx, playery, picMerge)
            View.Update
            delay (40)
        end for
    end if
end buttonpresses


Then that file is included into the actual program, using those procedures.

code:

View.Set ('graphics:320;290, nobuttonbar, title: The Legend of Zelda: Links Awakening, offscreenonly')
var background : array 1 .. 8, 1 .. 10 of int
var secondary : array 1 .. 8, 1 .. 10 of int
var i, j, input, choice, temp, playerx, playery, button, lastpicture, savepointx, savepointy, deathpointx, deathpointy, deathchoice,
    temp1, temp2, shieldsave : int
var file : string
var press : array char of boolean

include "Declerations.t"

choice := 83
temp := choice

receivebackgroundinfo
drawbackground
drawconsole
View.Update
playerx := 130
playery := 70
player := 1
lastpicture := 1
savepointx := 130
savepointy := 70
deathchoice := 83
temp1 := 1
temp2 := 5
colorback (7) % Black
cls
var clr : int := 218 % The color to assign to
var text1 : int := Font.New ("Times New Roman:18:Bold") % First Font
for z : 0 .. 39
    RGB.SetColor (clr, 0, 0, z / 39)
    Font.Draw ("Welcome to...", (maxx div 2) - (Font.Width ("Welcome to...", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
    drawfillbox ((maxx div 2) - Font.Width ("Welcome to...", text1) - 5, (maxy div 2) - 13, ((maxx div 2) + Font.Width ("Welcome to...", text1) + 5), (maxy div 2) + 13, 7)
    delay (50)
end for
delay (1000)
for decreasing z : 39 .. 0
    RGB.SetColor (clr, 0, 0, z / 39)
    Font.Draw ("Welcome to...", (maxx div 2) - (Font.Width ("Welcome to...", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
    drawfillbox ((maxx div 2) - Font.Width ("Welcome to...", text1) - 5, (maxy div 2) - 13, ((maxx div 2) + Font.Width ("Welcome to...", text1) + 5), (maxy div 2) + 13, 7)
    delay (50)
end for
delay (1000)
for z : 0 .. 39
    RGB.SetColor (clr, 0, 0, z / 39)
    Font.Draw ("The Legend of Zelda", (maxx div 2) - (Font.Width ("The Legend of Zelda", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
    drawfillbox ((maxx div 2) - Font.Width ("The Legend of Zelda", text1) - 5, (maxy div 2) - 15, ((maxx div 2) + Font.Width ("The Legend of Zelda", text1) + 5), (maxy div 2) + 13, 7)
    delay (50)
end for
delay (1000)
for decreasing z : 39 .. 0
    RGB.SetColor (clr, 0, 0, z / 39)
    Font.Draw ("The Legend of Zelda", (maxx div 2) - (Font.Width ("The Legend of Zelda", text1) div 2), (maxy div 2) - 9, text1, clr)
    View.Update
    drawfillbox ((maxx div 2) - Font.Width ("The Legend of Zelda", text1) - 5, (maxy div 2) - 15, ((maxx div 2) + Font.Width ("The Legend of Zelda", text1) + 5), (maxy div 2) + 13, 7)
    delay (50)
end for

loop
    Input.KeyDown (press)
    barrier
    ledgefalling
    holefall
    if shieldmove = 1 then
        if player = 1 or player = 5 then
            temp1 := 9
            temp2 := 25
        elsif player = 2 or player = 6 then
            temp1 := 10
            temp2 := 24
        elsif player = 3 or player = 7 then
            temp1 := 11
            temp2 := 27
        elsif player = 4 or player = 8 then
            temp1 := 12
            temp2 := 26
        end if
    elsif shieldmove = 0 then
        if player = 9 or player = 25 then
            temp1 := 1
            temp2 := 5
        elsif player = 10 or player = 24 then
            temp1 := 2
            temp2 := 6
        elsif player = 11 or player = 27 then
            temp1 := 3
            temp2 := 7
        elsif player = 12 or player = 26 then
            temp1 := 4
            temp2 := 8
        end if
    end if
    if press (KEY_UP_ARROW) then
        if playery >= 228 then
            choice := choice + 16
            recievesecondaryinfo
            switchup
            playery := 2
            deathpointx := playerx
            deathpointy := playery
        elsif whatdotcolor (playerx + 35, playery + 50) ~= 245 and whatdotcolor (playerx + 53, playery + 50) ~= 245 and whatdotcolor (playerx + 35, playery + 50) ~= 230 and whatdotcolor (playerx +
            53, playery + 50) ~= 230 then
            if shieldmove = 1 then
                temp1 := 11
                temp2 := 27
            else
                temp1 := 3
                temp2 := 7
            end if
            playery += 2
            movementcounter += 1
        end if
    end if
    if press (KEY_DOWN_ARROW) then
        if playery <= 2 then
            choice := choice - 16
            recievesecondaryinfo
            switchdown
            playery := 228
            deathpointx := playerx
            deathpointy := playery
        elsif whatdotcolor (playerx + 35, playery + 30) ~= 245 and whatdotcolor (playerx + 53, playery + 30) ~= 245 and whatdotcolor (playerx + 35, playery + 30) ~= 230 and whatdotcolor (playerx +
                53, playery + 30) ~= 230 then
            if shieldmove = 1 then
                temp1 := 9
                temp2 := 25
            else
                temp1 := 1
                temp2 := 5
            end if
            playery -= 2
            movementcounter += 1
        end if
    end if
    if press (KEY_RIGHT_ARROW) then
        if playerx >= 263 then
            choice := choice + 1
            recievesecondaryinfo
            switchright
            playerx := -30
            deathpointx := playerx + 5
            deathpointy := playery
        elsif whatdotcolor (playerx + 58, playery + 35) ~= 245 and whatdotcolor (playerx + 58, playery + 48) ~= 245 and whatdotcolor (playerx + 58, playery + 35) ~= 230 and whatdotcolor (playerx +
                58, playery + 48) ~= 230 then
            if press (KEY_UP_ARROW) then
            elsif press (KEY_DOWN_ARROW) then
            else
                if shieldmove = 1 then
                    temp1 := 10
                    temp2 := 24
                else
                    temp1 := 2
                    temp2 := 6
                end if
                playerx += 2
                movementcounter += 1
            end if
        end if
    end if
    if press (KEY_LEFT_ARROW) then
        if playerx <= -30 then
            choice := choice - 1
            recievesecondaryinfo
            switchleft
            playerx := 263
            deathpointx := playerx
            deathpointy := playery
        elsif whatdotcolor (playerx + 30, playery + 35) ~= 245 and whatdotcolor (playerx + 30, playery + 48) ~= 245 and whatdotcolor (playerx + 30, playery + 35) ~= 230 and whatdotcolor (playerx +
                30, playery + 48) ~= 230 then
            if press (KEY_UP_ARROW) then
            elsif press (KEY_DOWN_ARROW) then
            else
                if shieldmove = 1 then
                    temp1 := 12
                    temp2 := 26
                else
                    temp1 := 4
                    temp2 := 8
                end if
                playerx -= 2
                movementcounter += 1
            end if
        end if
    end if
    if press (KEY_ENTER) then
        startmenu
    end if
    if choice ~= temp then
        temp := choice
        secondarytoback
    end if
    cls
    drawbackground
    drawconsole
    if press (KEY_CTRL) then
        button := 1
        buttonpresses (player, button)
    elsif press (KEY_ALT) then
        button := 2
        buttonpresses (player, button)
    else
        shieldmove := 0
    end if
    movement (player, temp1, temp2)
    Pic.Draw (playerpics (player), playerx, playery, picMerge)
    View.Update
    delay (4)
end loop



If I manage to find the nicer version on a floppy I'll post that, it does the exact same thing, but in about 1/2 the lines. Hope you enjoy.

LeGoLaS

Author:  [Gandalf] [ Thu Apr 21, 2005 12:28 am ]
Post subject: 

Amazing, I thought for sure that nothing more would be added of this game... Shocked

Are you going to continue working on this game? Or can I (or anyone else) continue your work (giving you credit of course Smile ). Hope to see some updates from you though!

Author:  Dudewhatzup1 [ Sun May 01, 2005 10:08 pm ]
Post subject: 

hey not to sound greedy btu could i too cause i would love to look st the code and edit and learn from the code... Embarassed Razz thnx (if you agree, no hard feelings if you dont)

Author:  Toxic_Ninja [ Fri May 06, 2005 9:52 am ]
Post subject: 

Ive been using turing for about a month now so please dont judge me. I can get it to work (the zelda code), it tells me their are undeclared variables but when i declare all of them the subscript on the background skrews up pleas help.

Author:  Legolas [ Mon May 09, 2005 10:02 pm ]
Post subject: 

Your problem is probably that you don't have it in two seperate turing files. THe first coding has to be in a file named "Declerations.t" and then the second coding that i posted has to be put in another turing file which you can name whatever you would like.

Author:  Toxic_Ninja [ Tue May 10, 2005 6:58 pm ]
Post subject: 

Oh i get it thx alot

edit: no wait theris still a problem i run the first file and it opens the Declerations but declerations gets an error at Pic.Draw (pic (background (x, y)), i, j, picCopy) line 96 saying undelcared variable

Author:  Dylan-182 [ Fri May 13, 2005 7:38 am ]
Post subject: 

haha Shocked wow Shocked this game is amazing Very Happy i love it lol good work on it Razz

Author:  Legolas [ Sat May 14, 2005 9:25 am ]
Post subject: 

Your problem is i cut out all the picture declerations to save space, they go at the top of declerations.t. There are about 150 lines of picture declerations in this version before i managed to switch it up and make it work better. So i can post the entire declerations file if neone would like to run the game directly from the code.

Author:  strike_hawk89 [ Sun May 15, 2005 10:15 am ]
Post subject: 

yes plz Very Happy

Author:  Toxic_Ninja [ Mon May 16, 2005 9:19 am ]
Post subject: 

yes plz and thx

Author:  strike_hawk89 [ Wed May 18, 2005 9:40 am ]
Post subject: 

plz post the picture declerations soon. I want to try to understand the code.

Author:  Notoroge [ Wed May 18, 2005 4:41 pm ]
Post subject: 

Someone requested some pics a couple of pages back. No idea if you still want them or not, but either way, here you go.

Author:  RscMod [ Fri May 20, 2005 10:25 am ]
Post subject:  quite good but make a update

get a update

Author:  strike_hawk89 [ Tue May 24, 2005 7:38 pm ]
Post subject: 

declerations....................... **eye twitch**.................plz

Author:  Legolas [ Tue May 24, 2005 8:03 pm ]
Post subject: 

Heres the full declerations file, in all is terribly programmed glory. Because i had to be able to differentiate between the different pictures they are all named differently instead of being in a for loop.

code:
type menu :
    record
        picture : int
        item : int
    end record

var pic : array 1 .. 133 of int
var console : array 1 .. 7 of int
var playerpics : array 1 .. 27 of int
var positioning : array 1 .. 6, 1 .. 2 of menu
var watercounter, flowercounter, movementcounter, tempa, tempb, player, weaponmovementcounter, health, healthtotal, shieldmove : int
var swinging : array 1 .. 16 of int

shieldmove := 0
health := 6
healthtotal := 3
for x : 1 .. 6
    for y : 1 .. 2
        positioning (x, y).item := 0
        positioning (x, y).picture := Pic.FileNew ("Pictures/Console/Start Menu/Empty1.bmp")
    end for
end for
positioning (1, 1).picture := Pic.FileNew ("Pictures/Console/Start Menu/Shield1.bmp")
positioning (1, 1).item := 1
positioning (1, 2).item := 2
positioning (1, 2).picture := Pic.FileNew ("Pictures/Console/Start Menu/Sword.bmp")

swinging (1) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down1.bmp")
swinging (2) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down2.bmp")
swinging (3) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down3.bmp")
swinging (4) := Pic.FileNew ("Pictures/Player/Sword Swinging/Down4.bmp")
swinging (5) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right1.bmp")
swinging (6) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right2.bmp")
swinging (7) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right3.bmp")
swinging (8) := Pic.FileNew ("Pictures/Player/Sword Swinging/Right4.bmp")
swinging (9) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up1.bmp")
swinging (10) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up2.bmp")
swinging (11) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up3.bmp")
swinging (12) := Pic.FileNew ("Pictures/Player/Sword Swinging/Up4.bmp")
swinging (13) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left1.bmp")
swinging (14) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left2.bmp")
swinging (15) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left3.bmp")
swinging (16) := Pic.FileNew ("Pictures/Player/Sword Swinging/Left4.bmp")

playerpics (1) := Pic.FileNew ("Pictures/Player/With Shield/Down1.bmp")
playerpics (2) := Pic.FileNew ("Pictures/Player/With Shield/Right1.bmp")
playerpics (3) := Pic.FileNew ("Pictures/Player/With Shield/Up1.bmp")
playerpics (4) := Pic.FileNew ("Pictures/Player/With Shield/Left1.bmp")
playerpics (5) := Pic.FileNew ("Pictures/Player/With Shield/Down2.bmp")
playerpics (6) := Pic.FileNew ("Pictures/Player/With Shield/Right2.bmp")
playerpics (7) := Pic.FileNew ("Pictures/Player/With Shield/Up2.bmp")
playerpics (8) := Pic.FileNew ("Pictures/Player/With Shield/Left2.bmp")
playerpics (9) := Pic.FileNew ("Pictures/Player/With Shield/SDown1.bmp")
playerpics (10) := Pic.FileNew ("Pictures/Player/With Shield/SRight1.bmp")
playerpics (11) := Pic.FileNew ("Pictures/Player/With Shield/SUp1.bmp")
playerpics (12) := Pic.FileNew ("Pictures/Player/With Shield/SLeft1.bmp")
playerpics (13) := Pic.FileNew ("Pictures/Player/Moveables/Falling1.bmp")
playerpics (14) := Pic.FileNew ("Pictures/Player/Moveables/Falling2.bmp")
playerpics (15) := Pic.FileNew ("Pictures/Player/Moveables/Falling3.bmp")
playerpics (16) := Pic.FileNew ("Pictures/Player/With Shield/Hurt1.bmp")
playerpics (17) := Pic.FileNew ("Pictures/Player/With Shield/Hurt2.bmp")
playerpics (18) := Pic.FileNew ("Pictures/Player/With Shield/Hurt3.bmp")
playerpics (19) := Pic.FileNew ("Pictures/Player/With Shield/Hurt4.bmp")
playerpics (20) := Pic.FileNew ("Pictures/Player/With Shield/Death.bmp")
playerpics (21) := Pic.FileNew ("Pictures/Player/Flipping/FlipD1.bmp")
playerpics (22) := Pic.FileNew ("Pictures/Player/Flipping/FlipD2.bmp")
playerpics (23) := Pic.FileNew ("Pictures/Player/Flipping/FlipD3.bmp")
playerpics (24) := Pic.FileNew ("Pictures/Player/With Shield/SRight2.bmp")
playerpics (25) := Pic.FileNew ("Pictures/Player/With Shield/SDown2.bmp")
playerpics (26) := Pic.FileNew ("Pictures/Player/With Shield/SLeft2.bmp")
playerpics (27) := Pic.FileNew ("Pictures/Player/With Shield/SUp2.bmp")


console (1) := Pic.FileNew ("Pictures/Console/console.bmp")
console (2) := Pic.FileNew ("Pictures/Console/Start Menu/Selector.bmp")
console (3) := Pic.FileNew ("Pictures/Console/Start Menu/MainBack.bmp")
console (4) := Pic.FileNew ("Pictures/Console/Start Menu/MainBack.bmp")
console (5) := Pic.FileNew ("Pictures/Console/Heart0.bmp")
console (6) := Pic.FileNew ("Pictures/Console/Heart1.bmp")
console (7) := Pic.FileNew ("Pictures/Console/Heart2.bmp")

pic (1) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass1.bmp")
pic (2) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass2.bmp")
pic (3) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass3.bmp")
pic (4) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass4.bmp")
pic (5) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/Sgrass5.bmp")
pic (6) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass1.bmp")
pic (7) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass2.bmp")
pic (8) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass3.bmp")
pic (9) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SCgrass4.bmp")
pic (10) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SgrassV.bmp")
pic (11) := Pic.FileNew ("Pictures/GroundTypes/Pathway1.bmp")
pic (12) := Pic.FileNew ("Pictures/Interaction/Ground/Grass1.bmp")
pic (13) := Pic.FileNew ("Pictures/GroundTypes/Fence1.bmp")
pic (14) := Pic.FileNew ("Pictures/Interaction/Ground/Bush1.bmp")
pic (15) := Pic.FileNew ("Pictures/Buildings/House1.bmp")
pic (16) := Pic.FileNew ("Pictures/Buildings/Door1.bmp")
pic (17) := Pic.FileNew ("Pictures/Buildings/Roof1.bmp")
pic (18) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft1.bmp")
pic (19) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft1.bmp")
pic (20) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright1.bmp")
pic (21) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright1.bmp")
pic (22) := Pic.FileNew ("Pictures/Buildings/House2.bmp")
pic (23) := Pic.FileNew ("Pictures/Buildings/Door2.bmp")
pic (24) := Pic.FileNew ("Pictures/Buildings/Shop1.bmp")
pic (25) := Pic.FileNew ("Pictures/Buildings/Shop2.bmp")
pic (26) := Pic.FileNew ("Pictures/Buildings/Shop3.bmp")
pic (27) := Pic.FileNew ("Pictures/Buildings/Shop4.bmp")
pic (28) := Pic.FileNew ("Pictures/Buildings/Shop5.bmp")
pic (29) := Pic.FileNew ("Pictures/Buildings/Shop6.bmp")
pic (30) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall1.bmp")
pic (31) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall2.bmp")
pic (32) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall3.bmp")
pic (33) := Pic.FileNew ("Pictures/GroundTypes/Stairs1.bmp")
pic (34) := Pic.FileNew ("Pictures/GroundTypes/Special Grass/SgrassH.bmp")
pic (35) := Pic.FileNew ("Pictures/GroundTypes/Tiles1.bmp")
pic (36) := Pic.FileNew ("Pictures/GroundTypes/Flowers1.bmp")
pic (37) := Pic.FileNew ("Pictures/Specials/RStatueB.bmp")
pic (38) := Pic.FileNew ("Pictures/Specials/RStatueT.bmp")
pic (39) := Pic.FileNew ("Pictures/GroundTypes/Tiles2.bmp")
pic (40) := Pic.FileNew ("Pictures/Buildings/Door3.bmp")
pic (41) := Pic.FileNew ("Pictures/Buildings/Roof2.bmp")
pic (42) := Pic.FileNew ("Pictures/Specials/BowWowPost.bmp")
pic (43) := Pic.FileNew ("Pictures/Buildings/Roof3.bmp")
pic (44) := Pic.FileNew ("Pictures/Buildings/BowwowR1.bmp")
pic (45) := Pic.FileNew ("Pictures/Buildings/BowwowR2.bmp")
pic (46) := Pic.FileNew ("Pictures/Buildings/BowwowR3.bmp")
pic (47) := Pic.FileNew ("Pictures/Buildings/BowwowR4.bmp")
pic (48) := Pic.FileNew ("Pictures/Buildings/BowwowR5.bmp")
pic (49) := Pic.FileNew ("Pictures/Buildings/BowwowR6.bmp")
pic (50) := Pic.FileNew ("Pictures/GroundTypes/Grass2.bmp")
pic (51) := Pic.FileNew ("Pictures/GroundTypes/Stones1.bmp")
pic (52) := Pic.FileNew ("Pictures/GroundTypes/Stones2.bmp")
pic (53) := Pic.FileNew ("Pictures/Buildings/HouseR1.bmp")
pic (54) := Pic.FileNew ("Pictures/Buildings/HouseR2.bmp")
pic (55) := Pic.FileNew ("Pictures/Buildings/HouseR3.bmp")
pic (56) := Pic.FileNew ("Pictures/Buildings/HouseR4.bmp")
pic (57) := Pic.FileNew ("Pictures/Buildings/HouseR5.bmp")
pic (58) := Pic.FileNew ("Pictures/Buildings/HouseR6.bmp")
pic (59) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft2.bmp")
pic (60) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright2.bmp")
pic (61) := Pic.FileNew ("Pictures/Interaction/Ground/Rock1.bmp")
pic (62) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT1.bmp")
pic (63) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT2.bmp")
pic (64) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT3.bmp")
pic (65) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT4.bmp")
pic (66) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT5.bmp")
pic (67) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT6.bmp")
pic (68) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT7.bmp")
pic (69) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT8.bmp")
pic (70) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT9.bmp")
pic (71) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT10.bmp")
pic (72) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT11.bmp")
pic (73) := Pic.FileNew ("Pictures/Buildings/HouseR7.bmp")
pic (74) := Pic.FileNew ("Pictures/Interaction/Ground/Sign1.bmp")
pic (75) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall4.bmp")
pic (76) := Pic.FileNew ("Pictures/Buildings/Door4.bmp")
pic (77) := Pic.FileNew ("Pictures/GroundTypes/Water/Water1.bmp")
pic (78) := Pic.FileNew ("Pictures/GroundTypes/Water/Water2.bmp")
pic (79) := Pic.FileNew ("Pictures/GroundTypes/Water/Water3.bmp")
pic (80) := Pic.FileNew ("Pictures/Buildings/ShopR1.bmp")
pic (81) := Pic.FileNew ("Pictures/Buildings/ShopR2.bmp")
pic (82) := Pic.FileNew ("Pictures/Buildings/ShopR3.bmp")
pic (83) := Pic.FileNew ("Pictures/Buildings/ShopR4.bmp")
pic (84) := Pic.FileNew ("Pictures/Buildings/ShopR5.bmp")
pic (85) := Pic.FileNew ("Pictures/Buildings/ShopR6.bmp")
pic (86) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT12.bmp")
pic (87) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT13.bmp")
pic (88) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT14.bmp")
pic (89) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT15.bmp")
pic (90) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT16.bmp")
pic (91) := Pic.FileNew ("Pictures/Buildings/Roof4.bmp")
pic (92) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT17.bmp")
pic (93) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT18.bmp")
pic (94) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT19.bmp")
pic (95) := Pic.FileNew ("Pictures/Interaction/Ground/Hole1.bmp")
pic (96) := Pic.FileNew ("Pictures/GroundTypes/Walls/WallT20.bmp")
pic (97) := Pic.FileNew ("Pictures/GroundTypes/Tiles3.bmp")
pic (98) := Pic.FileNew ("Pictures/GroundTypes/Bars1.bmp")
pic (99) := Pic.FileNew ("Pictures/Buildings/Scorp1.bmp")
pic (100) := Pic.FileNew ("Pictures/Buildings/Scorp2.bmp")
pic (101) := Pic.FileNew ("Pictures/Buildings/Scorp3.bmp")
pic (102) := Pic.FileNew ("Pictures/GroundTypes/Flowers2.bmp")
pic (103) := Pic.FileNew ("Pictures/GroundTypes/Flowers3.bmp")
pic (104) := Pic.FileNew ("Pictures/Interaction/Ground/Bush2.bmp")
pic (105) := Pic.FileNew ("Pictures/GroundTypes/Sand1.bmp")
pic (106) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft3.bmp")
pic (107) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft3.bmp")
pic (108) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright3.bmp")
pic (109) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright3.bmp")
pic (110) := Pic.FileNew ("Pictures/GroundTypes/Sand2.bmp")
pic (111) := Pic.FileNew ("Pictures/GroundTypes/Sand3.bmp")
pic (112) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopleft4.bmp")
pic (113) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeleft4.bmp")
pic (114) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treetopright4.bmp")
pic (115) := Pic.FileNew ("Pictures/GroundTypes/Trees/Treeright4.bmp")
pic (116) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater1.bmp")
pic (117) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater2.bmp")
pic (118) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater3.bmp")
pic (119) := Pic.FileNew ("Pictures/GroundTypes/Water/CWater2.bmp")
pic (120) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater1.bmp")
pic (121) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater2.bmp")
pic (122) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater3.bmp")
pic (123) := Pic.FileNew ("Pictures/GroundTypes/Water/2CWater2.bmp")
pic (124) := Pic.FileNew ("Pictures/GroundTypes/Sand4.bmp")
pic (125) := Pic.FileNew ("Pictures/GroundTypes/Sand5.bmp")
pic (126) := Pic.FileNew ("Pictures/GroundTypes/Walls/Wall6.bmp")
pic (127) := Pic.FileNew ("Pictures/Interaction/Doors/Rock1.bmp")
pic (128) := Pic.FileNew ("Pictures/GroundTypes/Flowers2.bmp")
pic (129) := Pic.FileNew ("Pictures/Interaction/Ground/Chest1.bmp")
pic (130) := Pic.FileNew ("Pictures/Interaction/Ground/BushA1.bmp")
pic (131) := Pic.FileNew ("Pictures/Interaction/Ground/BushA2.bmp")
pic (132) := Pic.FileNew ("Pictures/Interaction/Ground/BushA4.bmp")
pic (133) := Pic.FileNew ("Pictures/Interaction/Ground/BushA5.bmp")

watercounter := 0
flowercounter := 0
movementcounter := 0


procedure movement (var current, num1, num2 : int)
    if current ~= num1 and current ~= num2 then
        current := num1
        lastpicture := num1
    end if
    if movementcounter > 10 then
        if current = num1 then
            current := num2
            lastpicture := num2
        elsif player = num2 then
            current := num1
            lastpicture := num1
        end if
    end if
    if movementcounter > 10 then
        movementcounter := 0
    end if
end movement

procedure drawbackground
    Draw.FillBox (0, 0, 500, 500, white)
    j := 256
    for x : 1 .. 8
        i := 0
        for y : 1 .. 10
            if watercounter > 30 then
                if background (x, y) = 77 then
                    background (x, y) := 78
                elsif background (x, y) = 78 then
                    background (x, y) := 79
                elsif background (x, y) = 79 then
                    background (x, y) := 77
                end if
                if background (x, y) = 116 then
                    background (x, y) := 117
                elsif background (x, y) = 117 then
                    background (x, y) := 118
                elsif background (x, y) = 118 then
                    background (x, y) := 119
                elsif background (x, y) = 119 then
                    background (x, y) := 116
                end if
                if background (x, y) = 120 then
                    background (x, y) := 121
                elsif background (x, y) = 121 then
                    background (x, y) := 122
                elsif background (x, y) = 122 then
                    background (x, y) := 123
                elsif background (x, y) = 123 then
                    background (x, y) := 120
                end if
            end if
            if flowercounter > 20 then
                if background (x, y) = 36 then
                    background (x, y) := 102
                elsif background (x, y) = 102 then
                    background (x, y) := 103
                elsif background (x, y) = 103 then
                    background (x, y) := 128
                elsif background (x, y) = 128 then
                    background (x, y) := 36
                end if
            end if
            Pic.Draw (pic (background (x, y)), i, j, picCopy)
            i += 32
        end for
        j -= 32
    end for
    if watercounter > 30 then
        watercounter := 0
    else
        watercounter += 1
    end if
    if flowercounter > 20 then
        flowercounter := 0
    else
        flowercounter += 1
    end if
end drawbackground


procedure barrier
    j := 256
    for x : 1 .. 8
        i := 0
        for y : 1 .. 10
            if background (x, y) = 13 or background (x, y) = 14 or background (x, y) = 30 or background (x, y) = 31 or background (x, y) = 32 or background (x, y) = 51 or
                    background (x, y) = 52 or background (x, y) = 61 or background (x, y) = 62 or background (x, y) = 63 or background (x, y) = 64 or background (x, y) = 65 or
                    background (x, y) = 66 or background (x, y) = 67 or background (x, y) = 68 or background (x, y) = 69 or background (x, y) = 70 or background (x, y) = 71
                    or background (x, y) = 74 or background (x, y) = 75 or background (x, y) = 15 or background (x, y) = 16 or background (x, y) = 17 or background (x, y) = 106
                    or background (x, y) = 22 or background (x, y) = 23 or background (x, y) = 24 or background (x, y) = 25 or background (x, y) = 26 or background (x, y) = 27
                    or background (x, y) = 28 or background (x, y) = 29 or background (x, y) = 37 or background (x, y) = 38 or background (x, y) = 40 or background (x, y) = 41
                    or background (x, y) = 43 or background (x, y) = 44 or background (x, y) = 45 or background (x, y) = 46 or background (x, y) = 47 or background (x, y) = 48
                    or background (x, y) = 49 or background (x, y) = 53 or background (x, y) = 54 or background (x, y) = 55 or background (x, y) = 56 or background (x, y) = 57
                    or background (x, y) = 58 or background (x, y) = 73 or background (x, y) = 76 or background (x, y) = 18 or background (x, y) = 19 or background (x, y) = 20
                    or background (x, y) = 21 or background (x, y) = 59 or background (x, y) = 60 or background (x, y) = 80 or background (x, y) = 81 or background (x, y) = 82
                    or background (x, y) = 83 or background (x, y) = 84 or background (x, y) = 85 or background (x, y) = 86 or background (x, y) = 87 or background (x, y) = 88
                    or background (x, y) = 89 or background (x, y) = 90 or background (x, y) = 91 or background (x, y) = 92 or background (x, y) = 94 or background (x, y) = 108
                    or background (x, y) = 96 or background (x, y) = 96 or background (x, y) = 99 or background (x, y) = 100 or background (x, y) = 101 or background (x, y) = 107
                    or background (x, y) = 98 or background (x, y) = 109 or background (x, y) = 104 or background (x, y) = 114 or background (x, y) = 115 or background (x, y) = 113
                    or background (x, y) = 112 or background (x, y) = 120 or background (x, y) = 121 or background (x, y) = 122 or background (x, y) = 123 or background (x, y) = 124
                    or background (x, y) = 127 then
                Draw.FillBox (i, j, i + 32, j + 32, 245)
            end if
            if background (x, y) = 14 or background (x, y) = 104 then
                Draw.FillBox (i, j, i + 32, j + 32, 230)
            end if
            if background (x, y) = 42 then
                Draw.FillBox (i + 16, j, i + 32, j + 32, 245)
            end if
            if background (x, y) = 72 or background (x, y) = 93 then
                Draw.FillBox (i, j, i + 32, j + 16, 240)
            end if
            if background (x, y) = 95 then
                if y ~= 10 then
                    if background (x, y + 1) = 95 then
                        Draw.FillBox (i + 8, j + 8, i + 32, j + 24, 235)
                    end if
                else
                    Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
                end if
                if y ~= 1 then
                    if background (x, y - 1) = 95 then
                        Draw.FillBox (i, j + 8, i + 32, j + 24, 235)
                    else
                        Draw.FillBox (i + 8, j + 8, i + 24, j + 24, 235)
                    end if
                end if
            end if
            i += 32
        end for
        j -= 32
    end for
end barrier

procedure receivebackgroundinfo
    file := "Levels/" + intstr (choice) + ".dat"
    open : input, file, get
    for x : 1 .. 8
        for y : 1 .. 10
            get : input, background (x, y)
        end for
    end for
end receivebackgroundinfo

procedure recievesecondaryinfo
    file := "Levels/" + intstr (choice) + ".dat"
    open : input, file, get
    for x : 1 .. 8
        for y : 1 .. 10
            get : input, secondary (x, y)
        end for
    end for
    close (input)
end recievesecondaryinfo

procedure drawconsole
    var displayfull, outputx : int
    Pic.Draw (console (1), 0, 0, picCopy)
    Pic.Draw (positioning (1, 1).picture, 16, 4, picMerge)
    Pic.Draw (positioning (1, 2).picture, 96, 4, picMerge)
    displayfull := health div 2
    outputx := 210
    for b : 1 .. healthtotal
        if b <= displayfull then
            Pic.Draw (console (7), outputx, 20, picMerge)
        elsif health mod 2 = 1 and b = displayfull + 1 then
            Pic.Draw (console (6), outputx, 20, picMerge)
        else
            Pic.Draw (console (5), outputx, 20, picMerge)
        end if
        outputx += 15
    end for
end drawconsole

procedure switch

end switch
procedure switchright
    for m : 1 .. 40
        j := 256
        for x : 1 .. 8
            i := 0 - (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 256
        for x : 1 .. 8
            i := 320 - (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchright
procedure switchleft
    for m : 1 .. 40
        j := 256
        for x : 1 .. 8
            i := 0 + (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 256
        for x : 1 .. 8
            i := -320 + (8 * m)
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchleft

procedure switchup
    for m : 1 .. 32
        j := 256 - (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 508 - (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchup

procedure switchdown
    for m : 1 .. 32
        j := 256 + (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (background (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        j := 6 + (8 * m)
        for x : 1 .. 8
            i := 0
            for y : 1 .. 10
                Pic.Draw (pic (secondary (x, y)), i, j, picCopy)
                i += 32
            end for
            j -= 32
        end for
        drawconsole
        View.Update
        delay (12)
    end for
end switchdown


procedure secondarytoback
    for x : 1 .. 8
        for y : 1 .. 10
            background (x, y) := secondary (x, y)
        end for
    end for
end secondarytoback


procedure ledgefalling
    var flippingpics : int := 0
    if whatdotcolour (playerx + 40, playery + 30) = 240 then
        player := 21
        loop
            barrier
            playery -= 3
            if playery >= 228 then
                choice := choice + 16
                recievesecondaryinfo
                switchup
                playery := 2
                secondarytoback
                barrier
            end if
            if playery <= 2 then
                choice := choice - 16
                recievesecondaryinfo
                switchdown
                playery := 228
                secondarytoback
                barrier
            end if
            exit when whatdotcolour (playerx + 40, playery + 30) ~= 240 and whatdotcolour (playerx + 40, playery + 60) ~= 245 and whatdotcolour (playerx + 40, playery + 35) ~= 240 and
                whatdotcolour (playerx + 40, playery + 30) ~= 245

            if flippingpics > 10 then
                if player = 21 then
                    player := 22
                elsif player = 22 then
                    player := 23
                else
                    player := 1
                end if
            end if
            if flippingpics > 10 then
                flippingpics := 0
            else
                flippingpics += 1
            end if
            drawbackground
            Pic.Draw (playerpics (player), playerx, playery, picMerge)
            View.Update
            delay (7)
        end loop
    end if
end ledgefalling

procedure beinghurt
    health -= 1
    if health <= 0 then
        player := 1
        for x : 1 .. 14
            cls
            Pic.Draw (playerpics (player), playerx, playery, picMerge)
            delay (200)
            View.Update
            if player = 4 then
                player := 1
            else
                player += 1
            end if
        end for
        cls
        Pic.Draw (playerpics (20), playerx, playery, picMerge)
        View.Update
        delay (700)
        choice := deathchoice
        playerx := savepointx
        playery := savepointy
        health := 6
        recievesecondaryinfo
        secondarytoback
        temp := choice
    else
        if player = 1 or player = 5 then
            player := 1
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 1 then
                    player := 16
                else
                    player := 1
                end if
                delay (40)
            end for
            player := 1
        elsif player = 2 or player = 6 then
            player := 2
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 2 then
                    player := 17
                else
                    player := 2
                end if
                delay (40)
            end for
            player := 2
        elsif player = 3 or player = 7 then
            player := 3
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 3 then
                    player := 18
                else
                    player := 3
                end if
                delay (40)
            end for
            player := 3
        elsif player = 4 or player = 8 then
            player := 4
            for x : 1 .. 10
                drawbackground
                drawconsole
                Pic.Draw (playerpics (player), playerx, playery, picMerge)
                View.Update
                if player = 4 then
                    player := 19
                else
                    player := 4
                end if
                delay (40)
            end for
            player := 4
        end if
    end if
end beinghurt

procedure holefall
    if whatdotcolour (playerx + 45, playery + 40) = 235 then
        for l : 13 .. 15
            drawbackground
            drawconsole
            Pic.Draw (playerpics (l), playerx, playery, picMerge)
            View.Update
            delay (200)
        end for
        if health > 1 then
            playerx := deathpointx
            playery := deathpointy
        end if
        beinghurt
    end if
end holefall
procedure startmenu
    var choosex, choosey, currentarray1, currentarray2, x1, y1, temp : int
    choosex := 12
    choosey := 210
    drawbackground
    currentarray1 := 2
    currentarray2 := 1
    for x : 1 .. 256 by 3
        drawbackground
        Pic.Draw (console (4), 0, -256 + x, picCopy)
        View.Update
    end for
    delay (20)
    cls
    loop
        Input.KeyDown (press)
        Draw.FillBox (0, 0, 500, 500, white)
        Pic.Draw (console (3), 0, 0, picCopy)
        Pic.Draw (console (2), choosex, choosey, picMerge)
        Pic.Draw (positioning (1, 1).picture, 16, 256, picMerge)
        Pic.Draw (positioning (1, 2).picture, 96, 256, picMerge)
        if press (KEY_UP_ARROW) then
            if currentarray1 > 2 then
                choosey := choosey + 50
                currentarray1 := currentarray1 - 1
            end if
        end if
        if press (KEY_DOWN_ARROW) then
            if currentarray1 < 6 then
                choosey := choosey - 50
                currentarray1 := currentarray1 + 1
            end if
        end if
        if press (KEY_RIGHT_ARROW) then
            if currentarray2 = 1 then
                choosex := choosex + 63
                currentarray2 := currentarray2 + 1
            end if
        end if
        if press (KEY_LEFT_ARROW) then
            if currentarray2 = 2 then
                choosex := choosex - 63
                currentarray2 := currentarray2 - 1
            end if
        end if
        if press (KEY_CTRL) then
            temp := positioning (currentarray1, currentarray2).picture
            positioning (currentarray1, currentarray2).picture := positioning (1, 1).picture
            positioning (1, 1).picture := temp
            temp := positioning (currentarray1, currentarray2).item
            positioning (currentarray1, currentarray2).item := positioning (1, 1).item
            positioning (1, 1).item := temp
            delay (100)
        end if
        if press (KEY_ALT) then
            temp := positioning (currentarray1, currentarray2).picture
            positioning (currentarray1, currentarray2).picture := positioning (1, 2).picture
            positioning (1, 2).picture := temp
            temp := positioning (currentarray1, currentarray2).item
            positioning (currentarray1, currentarray2).item := positioning (1, 2).item
            positioning (1, 2).item := temp
            delay (100)
        end if
        exit when press (KEY_ENTER)
        x1 := 12
        y1 := 260
        for i : 2 .. 6
            y1 -= 50
            x1 := 12
            for j : 1 .. 2
                Pic.Draw (positioning (i, j).picture, x1, y1, picMerge)
                x1 += 63
            end for
        end for
        View.Update
        delay (80)
    end loop
    for x : 1 .. 256 by 3
        drawbackground
        Pic.Draw (console (4), 0, 0 - x, picCopy)
        Pic.Draw (positioning (1, 1).picture, 12, 258 - x, picMerge)
        Pic.Draw (positioning (1, 2).picture, 92, 258 - x, picMerge)
        View.Update
    end for
end startmenu

weaponmovementcounter := 0

procedure buttonpresses (var current, whichbutton : int)
    var number1, number2, bushslash, changepicx, changepicy : int
    if positioning (1, whichbutton).item = 1 then
        shieldmove := 1
    elsif positioning (1, whichbutton).item = 2 then
        barrier
        if current = 1 or current = 5 then
            number1 := 1
            number2 := 4
            if whatdotcolor (playerx + 53, playery + 12) = 230 then
                bushslash := 1
            else
                bushslash := 0
            end if
            if whatdotcolor (playerx + 53, playery + 12) = 230 or whatdotcolor (playerx + 53, playery + 17) = 230 or whatdotcolor (playerx + 53, playery + 23) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if playerx + 53 >= i and playerx + 53 <= i + 32 and ((playery + 12 >= j - 32 and playery + 12 <= j) or (playery + 17 >= j - 32 and playery + 17 <= j) or (playery + 23 >= j -
                                32 and playery + 23 <= j)) then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 2 or current = 6 then
            number1 := 5
            number2 := 8
            if whatdotcolor (playerx + 75, playery + 37) = 230 or whatdotcolor (playerx + 70, playery + 37) = 230 or whatdotcolor (playerx + 65, playery + 37) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if ((playerx + 75 >= i and playerx + 75 <= i + 32) or (playerx + 70 >= i and playerx + 70 <= i + 32) or (playerx + 65 >= i and playerx + 65 <= i + 32)) and playery + 37 >= j -
                                32 and playery + 37 <= j then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 3 or current = 7 then
            number1 := 9
            number2 := 12
            if whatdotcolor (playerx + 36, playery + 80) = 230 or whatdotcolor (playerx + 36, playery + 75) = 230 or whatdotcolor (playerx + 36, playery + 70) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if playerx + 36 >= i and playerx + 36 <= i + 32 and ((playery + 80 >= j - 32 and playery + 80 <= j) or (playery + 75 >= j - 32 and playery + 75 <= j) or (playery + 70 >= j -
                                32 and playery + 70 <= j)) then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if current = 4 or current = 8 then
            number1 := 13
            number2 := 16
            if whatdotcolor (playerx + 10, playery + 37) = 230 or whatdotcolor (playerx + 15, playery + 37) = 230 or whatdotcolor (playerx + 20, playery + 37) = 230 then
                bushslash := 1
                j := 256
                for y : 1 .. 8
                    i := 0
                    for x : 1 .. 10
                        if ((playerx + 10 >= i and playerx + 10 <= i + 32) or (playerx + 15 >= i and playerx + 15 <= i + 32) or (playerx + 20 >= i and playerx + 20 <= i + 32)) and playery + 37 >= j -
                                32 and playery + 37 <= j then
                            changepicx := y + 1
                            changepicy := x
                        end if
                        i += 32
                    end for
                    j -= 32
                end for
            else
                bushslash := 0
            end if
        end if
        if bushslash = 1 and background (changepicx, changepicy) = 14 then
            background (changepicx, changepicy) := 50
            secondary (changepicx, changepicy) := 50
        elsif bushslash = 1 and background (changepicx, changepicy) = 104 then
            background (changepicx, changepicy) := 105
            secondary (changepicx, changepicy) := 105
        end if
        for l : number1 .. number2
            drawbackground
            drawconsole
            if bushslash = 1 then
                if l = number1 then
                    Pic.Draw (pic (130), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 1 then
                    Pic.Draw (pic (131), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 2 then
                    Pic.Draw (pic (132), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                elsif l = number1 + 3 then
                    Pic.Draw (pic (133), ((changepicy - 1) * 32) - 10, 256 - ((changepicx - 1) * 32) - 10, picMerge)
                end if
            end if
            Pic.Draw (swinging (l), playerx, playery, picMerge)
            View.Update
            delay (40)
        end for
    end if
end buttonpresses


Author:  Delos [ Wed May 25, 2005 8:51 am ]
Post subject: 

Ouch! 130 something declarations!
Perhaps you ought to have named your pics "bg_##" or something to that effect.
Or...
"player_{movement}_##". You could dynamically change {movement} using some conditional statements and thus you'd be able to use a for loop (or loop) instead. It hurts to see that many hardcoded declarations!

Author:  Toxic_Ninja [ Wed May 25, 2005 9:19 am ]
Post subject: 

God bless you thx alot

Author:  gohan [ Wed May 25, 2005 10:26 am ]
Post subject: 

Hey Legolas, May I plz use the code as well!!!???....Plzz, and ty!!
I just wanna tell you my intention of using the code..(tht is, if you let me of coarse), I wanna reconfigure it a little..thts all!!!, and maybe add a little more to the map!!!

Your proggy was awesome for an RPG...I was wondering if you were going to update it, you know...with some enemies of some sort???


1 last question?....How long did all of this take you...(finding the pics, and coding the proggy)??[/code]

Author:  Dudewhatzup1 [ Wed May 25, 2005 11:03 am ]
Post subject: 

emm is it just me or is there an error when u try to run it...?

Author:  Legolas [ Wed May 25, 2005 2:00 pm ]
Post subject: 

Delos as i said i had not updated it to a for loop decleration because i had to be able to tell the difference between the 130 sumodd pictures so i could make the maps. Trying to tell number 98 from 99 would be hard if they were named like that.

Author:  [Gandalf] [ Wed May 25, 2005 11:05 pm ]
Post subject: 

Are you going to be updating the program? And can we modify/add to it?

You should post the error you are getting. One possibility is that you don't have the pictures?

Here are the steps to getting this to work:

1. Download the first file, with the executable
2. Make a new file called "Declerations.t" and put the new declarations there.
3. Make a new file called "Zelda.t" or whatever you want and put the second part of the code posted previously.
4. Copy both files to the folder with the executable.
5. Run it Smile.

Author:  gohan [ Mon May 30, 2005 1:43 pm ]
Post subject: 

Hey Legolas, how did you get Link to move when you had an arrow key pressed down?

plzz answer in Turing Help: "RPG character movement"

plz N thnx

Author:  Legolas [ Mon May 30, 2005 2:46 pm ]
Post subject: 

Not sure what you mean by that Gohan. Be a little more specific and I will try to answer the best of my ability. To those who wanted to know if they could use the code and current pictures posted, I will give most people permission under the condition that they quote my work and also ask my permission for the code first.

MSN: HighElfLegolas@hotmail.com

This code has not been updated and nor will be because i am attempting to improve the movement into a more "traditional" RPG. In such that I am trying to make the click move with smooth screen movement as best I can. The actual coding of this no longer was a challenge because I managed to do it, and the challenge is what I enjoy. So if anyone would like to use the code, just contact me. And Gohan, please elaborate on you question and I will answer as soon as possible.

Author:  gohan [ Tue May 31, 2005 10:10 am ]
Post subject: 

Hey Legolas, I meant like, changing from the left leg forward to the right leg forward....you know, like how we walk..lol..
right now, you have Link walking, and I know that they are two different pics...I would like to know how to input the 2 different pictures on the screen...to make it look like Link is walking; pic(1:left leg forward) and then pic(2:right leg forward)
and if it's alright, tell me how to get the pic to change from walking to standing still...
plzzz and thnxx


: