Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Zelda
Index -> Programming, Turing -> Turing Submissions
Goto page Previous  1, 2, 3, 4, 5, 6  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Artimes




PostPosted: Fri Apr 01, 2005 11:13 pm   Post subject: (No 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
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Sat Apr 02, 2005 3:37 pm   Post subject: (No subject)

Hey thats a pretty cool idea Artimes 8)
Jonny Tight Lips




PostPosted: Sun Apr 03, 2005 9:26 pm   Post subject: (No subject)

I would still like to see the sorce code.
Flikerator




PostPosted: Mon Apr 04, 2005 10:45 am   Post subject: (No 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 ^^;
jamonathin




PostPosted: Tue Apr 05, 2005 8:04 am   Post subject: (No 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
Artimes




PostPosted: Wed Apr 06, 2005 7:14 pm   Post subject: (No subject)

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




PostPosted: Wed Apr 06, 2005 8:20 pm   Post subject: (No subject)

Aiight, sounds good mayte! Flaming
Palindine




PostPosted: Thu Apr 07, 2005 3:30 am   Post subject: (No 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.
Sponsor
Sponsor
Sponsor
sponsor
barneyoncrack




PostPosted: Mon Apr 11, 2005 5:21 pm   Post subject: (No subject)

Shocked [/code]
jamonathin




PostPosted: Tue Apr 12, 2005 8:49 am   Post subject: (No 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.
RscMod




PostPosted: Thu Apr 14, 2005 10:38 am   Post subject: (No subject)

yep its cool
Legolas




PostPosted: Wed Apr 20, 2005 8:30 pm   Post subject: (No 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
[Gandalf]




PostPosted: Thu Apr 21, 2005 12:28 am   Post subject: (No 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!
Dudewhatzup1




PostPosted: Sun May 01, 2005 10:08 pm   Post subject: (No 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)
Toxic_Ninja




PostPosted: Fri May 06, 2005 9:52 am   Post subject: (No 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.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 4 of 6  [ 80 Posts ]
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Jump to:   


Style:  
Search: