Wumpus moderne oefening

Cursussen, tutorials
Plaats hier uw bijdrage.

Wumpus moderne oefening

Berichtdoor Gordon » di jun 05, 2007 11:14 pm

Ik ben vandaag hiermee gestart.

Doet u mee?

Volgende week hoop ik het af te hebben.

Gordon.
Bijlagen
wumpusG.zip
Eerst zal ik uitleggen hoe dit werkt..
en daarna wat er volgt.

Veel plezier.
(1.74 MiB) 243 keer gedownload
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am

Berichtdoor anthonio » wo jun 06, 2007 12:21 am

ik zou graag helpen maar ik zit tot over mijn over in het werk met mijn eigen projecten, andere keer misschien.
Dual boot: Ubuntu 8.04 - WIndows XP SP2 (via VMware) - Windows Vista 32bit - Toshiba L40 - Dual Core @ 1,76GHz - 1GB RAM - 120GB HDD - VDSL Connection
Avatar gebruiker
anthonio
 
Berichten: 281
Geregistreerd: zo mei 20, 2007 9:58 pm

Berichtdoor Gordon » do jun 07, 2007 8:47 pm

Mijn wumpus is reeds "a playable version"
Ik ben het nu aan het herschrijven zodat het ook voor
starters te volgen is.

Gordon

wordt vervolgd!
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am

Berichtdoor Gordon » wo jun 13, 2007 8:56 pm

Code: Selecteer alles
'WUMPUS G. Rahman

    'nomainwin
    WindowWidth = 800
    WindowHeight = 587
    UpperLeftX=int((DisplayWidth-WindowWidth)/2)
    UpperLeftY=int((DisplayHeight-WindowHeight)/2)


    loadbmp "wumpusOpening", "wumpus2.bmp"
    loadbmp "warrior1","warrior1spr.bmp"
    loadbmp "playscreen","wumpus4.bmp"
    graphicbox #m.g1, 1,  1, 800, 587

    button #m.b1 "                ",gaNaar,UL,330,530
    button #m.b2 "           ",gaNaar,UL,80,455
    button #m.b3 "           ",gaNaar,UL,350,455
    button #m.b4 "           ",gaNaar,UL,610,455

    bmpbutton #m.b5, "wumpus3titel.bmp",[startHelp],UL, 252, 350

    open "untitled" for window_popup as #m
    mOpen = 1
    #m "trapclose [quit.main0]"
    #m.b1 "!hide"
    #m.b2 "!hide"
    #m.b3 "!hide"
    #m.b4 "!hide"
    #m.b5 "hide"

    #m.g1 "background wumpusOpening"

'--------text on background
    hDC=GetDC(hWnd(#m.g1))
    call SetBkMode hDC,1
    call ReleaseDC hWnd(#m.g1),hDC

'--------- things to do here------
    'F1 help
    'ESC quit
    'wait

    playwave "welcomeMortals.wav",async

    #m.g1 "addsprite warrior warrior1"
    #m.g1 "spritexy warrior 300 100"

    for perc = 10 to 100  'step .5
    #m.g1 "spritescale warrior ";perc
    #m.g1 "drawsprites"
    next perc

    #m.b5 "show"
    #m.g1 "down; drawbmp wumpusOpening 0 0; flush "
    #m.g1 "drawsprites"

    dim m(22)
    m(int(rnd(0)*22)+1) = 10   'wumpus

        for t = 1 to 7
            k = int(rnd(0)*22)+1
            if m(k) <> 10 then m(k) = 5 '7 kloven
        next t

        for t = 1 to 5
            k = int(rnd(0)*22)+1
            if m(k) <> 10 and m(k) <> 5 then m(k) = 3 '5 vleermuizen
        next t

    wait


[startHelp]

            #m.b5 "hide"
            #m.g1 "drawsprites"


            [playMidi]
            playmidi "dracula.mid", howLong
            timer 100, [checkPlay]

            for perc = 100 to 1 step -5
            #m.g1 "spritescale warrior ";perc
            #m.g1 "drawsprites"
            next perc

            #m.g1 "down; drawbmp playscreen 0 0; flush"
            #m.g1 "place 130 30"
            #m.g1 "font size 14"
            #m.g1 "color white"
            test$ ="asshdas d  adf ioj as js poksd  asdfoi a"+chr$(13)+_
            "uyweriu y iru [o oi s[]of s sfo   iujo"+chr$(13)+_
            "uh e  dovg d oeo kdf;kgb, bdf;lk"
            #m.g1 "\"+test$

            r1 = int(rnd(0)*22+1)
            for Tn = 1 to r1
            read r2,r3,r4
            next Tn

            b(1) = r1
            b(2) = r2
            b(3) = r3
            b(4) = r4

            #m.b1 "Je staat in Tunnel  ";b(1)
            #m.b2 "Tunnel     ";b(2)
            #m.b3 "Tunnel     ";b(3)
            #m.b4 "Tunnel     ";b(4)

            #m.b1 "!show"
            #m.b2 "!show"
            #m.b3 "!show"
            #m.b4 "!show"

            wait

    sub gaNaar handle$

            restore
            r1 = b(val(right$(handle$,1)))
            for Tn = 1 to r1
            read r2,r3,r4
            next Tn

            b(1) = r1
            b(2) = r2
            b(3) = r3
            b(4) = r4

            if m(b(1)) = 10 then print "gedood door de WUMPUS"

            if m(b(1)) = 3 then print "verplaatst door vleermuis"

            if m(b(2)) = 5 then print  "Tocht!!";b(2)
            if m(b(3)) = 5 then print  "Tocht!!";b(3)
            if m(b(4)) = 5 then print  "Tocht!!";b(4)

            if m(b(2)) = 5 or m(b(3)) = 5 or m(b(4)) = 5 then print  "Tocht!!"

            #m.b1 "Je staat in Tunnel  ";b(1)
            #m.b2 "Tunnel     ";b(2)
            #m.b3 "Tunnel     ";b(3)
            #m.b4 "Tunnel     ";b(4)

            restore
            for Tn = 1 to b(2)
            read r22,r32,r42
            next Tn

            print "mmmm2 "; m(r22);m(r32);m(r42)

            restore
            for Tn = 1 to b(3)
            read r23,r33,r43
            next Tn

            print "mmmm3 "; m(r23);m(r33);m(r43)

            restore
            for Tn = 1 to b(4)
            read r24,r34,r44
            next Tn

            print "mmmm4 "; m(r24);m(r34);m(r44)

            data 11,02,12, 01,03,13, 02,04,14, 03,05,15, 04,06,16, 05,07,17
            data 06,08,18, 07,09,19, 08,10,20, 09,11,21, 10,01,22, 22,13,01
            data 12,14,02, 13,15,03, 14,16,04, 15,17,05, 16,18,06, 17,19,07
            data 18,20,08, 19,21,09, 20,22,10, 21,12,11
    end sub

'----------------------------------
Sub SetBkMode hDC, flag
'1=transparent
'2=opaque
CallDLL #gdi32, "SetBkMode",hDC As ulong,_
flag As long, RESULT As long
End Sub

Function GetDC(hWnd)
CallDLL #user32, "GetDC",hWnd As ulong,_
GetDC As ulong
End Function

Sub ReleaseDC hWnd, hDC
CallDLL#user32,"ReleaseDC",hWnd As ulong,_
hDC As ulong,result As long
End Sub


[checkPlay]
    if howLong = midipos( ) then [musicEnded]
    wait
[musicEnded]
    stopmidi
    timer 0
    wait
[quit.main0] 'End the program
    if mOpen = 1 then
        mOpen = 0 :timer 0 :close #m
        unloadbmp "wumpusOpening"
        stopmidi
    end if
    end

data 11,02,12, 01,03,13, 02,04,14, 03,05,15, 04,06,16, 05,07,17
data 06,08,18, 07,09,19, 08,10,20, 09,11,21, 10,01,22, 22,13,01
data 12,14,02, 13,15,03, 14,16,04, 15,17,05, 16,18,06
data 17,19,07, 18,20,08, 19,21,09, 20,22,10, 21,12,11



Succes

Gordon
Avatar gebruiker
Gordon
Site Admin
 
Berichten: 684
Geregistreerd: zo mei 22, 2005 12:50 am


Keer terug naar Leren programmeren met Liberty BASIC

Wie is er online

Gebruikers op dit forum: Geen geregistreerde gebruikers. en 1 gast

cron