Qbasicnews.com
November 21, 2019, 02:29:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: 90-minute old-skool game creation challenge in FB!  (Read 15354 times)
Adigun A. Polack
Ancient Guru
****
Posts: 691



WWW
« on: December 15, 2005, 09:15:27 PM »

Dearest all of you QB45/QB71/FB community,

Hello to all of you and welcome to my very first FB-only challenge!!!  Cheesy !

Alright.  Your drill for this one is to simply create a completed old-skool game in FreeBASIC in just 90 minutes or less using only these following rules:

    1.  You can use *any* library/libraries in FreeBASIC you want — such as GFXlib2, SDL, Allegro, BASS, FMOD, or whatever you’d like!

    2.  Your game must have a one- and/or a two-player feature, and no more than that.
    (One player games are alright with me as well!)

    3.  Your game must be in 2D only, not 3D.

    4.  Your game must ESPECIALLY have some sort of old-skool flavor to it, like a Tetris clone, or a remake of an old arcade classic (think Centipede, Gradius, or even Pang!), or even an adaption of an ancient computer/console game (for instance, something like Super Mario Bros. or Giana Sisters!)  Wink=b

    5. Text adventure games (like Zork) and adult-themed games are not allowed for this challenge.  Sorry.
    (However, all *other* text-based games are allowed as well!  :cool: )

    6. You may enter this challenge as many times as you want, no entry limit!  Cheesy
    [/list]
    Remember, your game must be completed in indeed 90 minutes or less from the moment you start your new game coding within FB from scratch.  If you are all done, present to me your game in this thread with the time that it took you to create your game.  Here is an example:

    Quote
    Game created: Z-Type (a quick and original R-Type clone)
    Time taken: 87 minutes

    (Game’s .zip/.rar file or source-code goes here!)


    As for your sprite/music creation for your game, you may take as long as you want, but you *only* get 90 minutes for the coding of your game alone (which includes piecing them all together in your code, too!).  Smiley !

    Ok.  The deadline for this challenge will definitely be on Saturday, February 18, 2006.  NO EXCEPTIONS.  After that, I will begin an official voting thread for this challenge, and it will take place then in the “General” section of these forums.

    So, start your coding engines, everyone, and may the best FB old-skool game win!!!  Cheesy



    PLACING YOU ON YOUR MARKS FOR SHEER BACK-IN-THE-DAY GAMING,


    Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”



    UPDATE (on 1-04-2006 at 5:03pm EST):  In order to add some decency and balance to this challenge, I have just now updated Rule #5 tonight.  Please see the rules again for more details, and thanks again, everybody!!!  Cheesy

    UPDATE (on 1-30-2006 at 12:43am EST):  This message has been just updated again, this time with the exact deadline date and some new and important information that I have just announced today.  Just so you know more clearly now.  Wink !
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Deleter
    Na_th_an
    *****
    Posts: 1292



    WWW
    « Reply #1 on: December 15, 2005, 11:09:19 PM »

    how are you going to regulate the 90 minute thing? Personally I think it would be cooler to have it be at a certain time or something.
    Logged

    Rattrapmax6
    __/--\__
    *****
    Posts: 2577



    WWW
    « Reply #2 on: December 15, 2005, 11:51:34 PM »

    Quote from: "Deleter"
    how are you going to regulate the 90 minute thing? Personally I think it would be cooler to have it be at a certain time or something.

    Easy,. post a message just before you start coding, then edit or post a message when you finish.. For further checking, you can see if the last modified date matches the time of release....  :wink:

    Sounds cool,. if I can, I might try.. =)
    Logged

    Kevin (x.t.r.GRAPHICS)

    Adigun A. Polack
    Ancient Guru
    ****
    Posts: 691



    WWW
    « Reply #3 on: December 15, 2005, 11:53:23 PM »

    To Deleter:

    If you can remember that on June 28, 2003, Na_th_an originally started a challenge like that entitled “Simple Games in 1 hour...”, only at that time it was for QuickBASIC only, more than a year before FreeBASIC was even released, man.  That one just clicked at me like lightning and gave me such a fresh idea and inspiration tonight for what this newly-revamped challenge in FB is really all about.... only this time, we are taking it old-skool and that I am giving you 30 minutes more in your coding for this drill, you know?  Smiley !  I would recommend that you study that other thread, as it would give you some clear ideas of what was presented there!

    And for a shot at playing the many game entries that were presented in that 1-hour challenge, please take a click right here to download them!  That should provide good some warm-up for you, Deleter.  :cool:

    With all this in mind, this new challenge has just started now from the moment I first written that in here (come to think of it, I had NOT even created another challenge in over a year at all, no, not one.... that is, until tonight!!  Wink ).  Should be very interesting by the way, and I hope to see you and others in this!  Peace!!!  Cheesy




    - Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Deleter
    Na_th_an
    *****
    Posts: 1292



    WWW
    « Reply #4 on: December 16, 2005, 12:38:25 AM »

    what would stop me from writing a "pac man" library, then writing the simple code needed to utilize it in 90 minutes? Tongue In any case, this sounds fun and I just might take some time this weekend to to it.
    Logged

    yetifoot
    Ancient Guru
    ****
    Posts: 575



    « Reply #5 on: December 16, 2005, 03:12:29 AM »

    i too thought the challenge could be a little flawed, what if someone plans out the whole program in their head, spending a few hours, then it wouldnt take them long to code it.

    anyway im not a game programmer, but i thought id have a go for fun.

    this one must surely be the worst game , and i did actaully spend 90mins total on it and had to stop.

    heres the graphics (should give you a good idea of my games programming skills!)




    if you ever played any of the daley thompson games on the old 8bit computers you know what i'm getting at

    m and n are the keys to run (alternate them fast) and space is to jump
    Code:

    ' daley thompsons long jump
    ' 4.47 Metres is my high score

    Option Explicit

    #include "vbcompat.bi"

    #define GFX_FULLSCREEN 1
    #define DALEYPATH "daley.bmp"

    Type MYSprite
      wid As Integer
      hei As Integer
      x As Integer
      y As Integer
      old_x As Integer
      old_y As Integer
      pic As Any ptr
    End Type

    Dim Shared Daley As MYSprite



    Sub Init_Daley
      Daley.wid = 30
      Daley.hei = 60
      Daley.x = 10
      Daley.y = 130
      Daley.old_x = Daley.x
      Daley.old_y = Daley.y
      Daley.pic = ImageCreate(Daley.wid, Daley.hei)
      BLOAD DALEYPATH, Daley.pic
    End Sub

    Sub GiveResult(endpos As double)
      if endpos < 190 Then
        Print "YOU IDIOT, YOU DIDNT EVEN CROSS THE LINE"
        Sleep 1000
        End
      Else
        Print Format(((endpos-190) /8), "0.00") & " Meters"
        Sleep 1000
        END
      End if
    End Sub


    Dim bg_pic As String
    Dim key As String
    Dim oldkey As String
    bg_pic="bg.bmp"
    Dim StartTime As Double
    Dim buf As Any ptr
    Dim sps As double
    ScreenRes 320, 200, 32, , GFX_FULLSCREEN


    cls

    buf = ImageCreate( 30, 60 )

    BLOAD bg_pic,0

    Init_Daley

    GET (Daley.x, Daley.y)-(Daley.x + Daley.wid - 1, Daley.y + Daley.hei - 1),buf
    PUT (Daley.x, Daley.y), Daley.pic, TRANS

    oldkey="m"

    Do

      key=""
      Do While key=""
        key = Inkey$
      Loop

      If Key = chr(27) Then Exit Do
      If Key = "n" And OldKey = "m" Then
        If StartTime = 0 Then StartTime = Timer
        OldKey="n"
        Daley.old_x = Daley.x
        Daley.x +=5
        If Daley.x >= 190 Then Print "FAULT"
      ElseIf Key = "m" And OldKey = "n" Then
        If StartTime = 0 Then StartTime = Timer
        OldKey="m"
        Daley.old_x = Daley.x
        Daley.x +=5
        If Daley.x >= 190 Then
          Print "FAULT"
          Sleep 1000
          End
        End If
      ElseIf Key = " " Then
        sps = ((Daley.x - 10) / 5) / (Timer - StartTime)
        GiveResult(Daley.x+(sps*4))
      Else
        Daley.old_x = Daley.x    
      End If

      PUT (Daley.old_x,Daley.old_y), buf, PSET
      GET (Daley.x, Daley.y)-(Daley.x + Daley.wid - 1, Daley.y + Daley.hei - 1), buf
      PUT (Daley.x, Daley.y), Daley.pic, TRANS

    Loop

    ImageDestroy Daley.pic
    ImageDestroy buf
    Logged

    EVEN MEN OF STEEL RUST.
    Z!re
    */-\*
    *****
    Posts: 4599


    « Reply #6 on: December 16, 2005, 03:30:13 AM »

    The idea of timed challenges, is to have the contesters chalenge themselves. There's no possible way of knowing if someone actually spent 90 minutes on it or not.
    So, if you want to be a retard and cheat, I guess noone can stop you. But you'd be missing the fun part of the challenge.
    Logged
    Adigun A. Polack
    Ancient Guru
    ****
    Posts: 691



    WWW
    « Reply #7 on: December 16, 2005, 04:03:34 PM »

    To yetifoot:

    Very nice little game you got here, man!!  :cool:

    Sure the graphics may be primitive at best, BUT, the gameplay and play control are really excellent here (that is what’s important!  Cheesy ).  And let me tell you why: it is because the main object of your game entitled Sports Game ++ is to run so quickly as *very* close to the long vertical black line as you can without even stepping over it, all before finally hitting the Space key!  It even has that old-skool flavor to it, as it reminds me of that 1983 Konami arcade classic called Track and Field / Hyper Olympic, you know that?

    So, five words for you: simple, quick, and VERY fun!!  Period, end of the conversation.  d=:king:=b

    I am officially accepting your entry, yetifoot!  Great job!!!

    (And by the way, just under a minute before this post was even placed up there, I beat your high score with a tremendous score of 6.07 meters from me!  Impressive, huh?  Wink )



    And to Deleter once again:

    To prove your point, if you were to create just any library at all (even in FB!), then that will be called library creation, not game creation.  So because of that, time will NOT count toward this challenge.  :cool:

    On the other hand, if you were to work on your main source code to your game (even with any library/libraries at all), then that would be called game creation, and thus here, time WILL count towards this challenge.  There is a difference.

    You got all of that now?  



    And finally, to everyone else out there:

    Since yetifoot did such an awesome work on his own entry, care to try and top that?  If so, JUST BRING IT, cause I’d love to see you do something *really* amazing in this 90-minute drill!!  Cheesy



    See you all back here shortly, everyone; and I thank you for your wonderful participation in entering this challenge, yetifoot!!!  ()v




    - Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”



    UPDATE (on December 16, 2005 at 7:25pm EST):  I just now topped my old high score with a jawdropping score of........

    7.07 meters!!!  IT’S A NEW WORLD RECORD!!!  :rotfl:
    (pardon the pun, by the way!  Wink )
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Nixon
    Member
    *
    Posts: 41



    WWW
    « Reply #8 on: December 29, 2005, 06:21:35 AM »

    I have made a 90 min game, though I think I might want to do a little bit more work on it. The AI for the 1 player game doesn't work, so its only a two player really at the moment. though I did have it finished on time.
    Logged
    Adigun A. Polack
    Ancient Guru
    ****
    Posts: 691



    WWW
    « Reply #9 on: December 29, 2005, 02:28:41 PM »

    To Nixon:

    Two players on your entry is alright with me, man!  Cheesy  And, so long as your thing is *really* done in 90 minutes or less (and no more than 90 indeed!), I will be happy to potentially accept your entry!

    See you again, and go for it!!  Wink=b



    AWAITING YOUR ENTRY,


    Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Nixon
    Member
    *
    Posts: 41



    WWW
    « Reply #10 on: December 29, 2005, 09:28:45 PM »

    Well after listening to 90mins of Led Zeppelin and drinking a few coffees I created this. Its a pitty I didn't work faster, I had so much more planned for it. the score was acually going to be useful and it would have been able to play more than one game in a row, if you want to, just edit it to call Setup, and just add a clear map thing in there.

    With 20mins left I hadn't seen it run, I wrote all subs and linked em together.

    This is only a 2 player game cause I had a bug with the AI, its an easy fix but I have to put it here like this.

    Enjoy.

    Code:

    DECLARE SUB Menu()
    DECLARE SUB Engine()
    DECLARE SUB Keys(P$)
    DECLARE SUB AI()
    DECLARE SUB Put.Bonus()
    DECLARE SUB Put.Wall()
    DECLARE SUB Display.Map()
    DECLARE SUB Display.Score()
    DECLARE SUB Display.Boarder()
    DECLARE SUB Move.Lines()
    DECLARE SUB Setup()
    DECLARE SUB Checkwinner()

    DIM SHARED Map(40,25), Lines(2,6), times(5) as double, Game, wallmem(3)

    const North = 1
    const South = 2
    const East = 3
    const West = 4

    const Slow = 1
    const Normal = 2
    const Fast = 3

    const Alive = 1
    const Dead = 2

    const Player1 = 1
    const Player2 = 2



    Screen 16,,,1
    Randomize timer

    menu()

    engine()


    sleep

    ' - = - = - = - = - = - = - = - =] S U B S [= - = - = - = - = - = - = - = - = -

    SUB Menu()
        color 15
        print "Lines"
        color 7
        print "1) 1 Player game"
        color 15
        print "2) 2 Player game"
        do
            P$ = inkey$
        loop until P$ = "2" or P$ = chr$(27)
        'if P$ = "1" then Game = Player1
        if P$ = "2" then Game = Player2
        if P$ = chr$(27) then end
        cls
        Display.Boarder()
        display.map()
        setup()
        Call engine()
    END SUB

    SUB Checkwinner()
        if lines(1,5) = dead or lines(2,5) = dead then
            cls
            if lines(1,5) = dead Then print "PLAYER 2 WINS":print "WITH A SCORE OF "+str$(lines(2,6))
            if lines(2,5) = dead Then print "PLAYER 1 WINS":print "WITH A SCORE OF "+str$(lines(1,6))        
            print "Hit [Enter] to end"
            do:P$=inkey$:loop until P$ = chr$(13)
            end
        end if
    end sub


    SUB Engine()
        do
            P$ = inkey$
            if P$ <> "" then Call keys(P$)
            if Game = Player1 then Call AI()
            Call Move.Lines()
            Call Checkwinner()
            Call Display.score()
            Call Put.bonus()
            Call Put.wall()
            Call display.Map()
        loop until P$ = chr$(27)
    END SUB


    SUB Setup()
        Lines(1,1) = 1
        Lines(1,2) = 1
        Lines(1,3) = Normal
        Lines(1,4) = East
        Lines(1,5) = Alive
        Lines(1,6) = 0  
        Lines(2,1) = 40
        Lines(2,2) = 21
        Lines(2,3) = Normal
        Lines(2,4) = West
        Lines(2,5) = Alive
        Lines(2,6) = 0
        WallMem(1) = 0
        WallMem(2) = 0    
        WallMem(3) = 0
    END SUB    


    SUB Move.Lines()
        if times(1) < timer - .01 then
            for i = 1 to 2
                if Lines(i,3) = Fast then
                    if lines(i,4) = North then lines(i,2) -= 1
                    if lines(i,4) = South then lines(i,2) += 1
                    if lines(i,4) = East then lines(i,1) += 1
                    if lines(i,4) = West then lines(i,1) -= 1
                end if
            next
            times(1) = timer
        elseif times(2) < timer - .1 then
            for i = 1 to 2
                if Lines(i,3) = Normal then
                    if lines(i,4) = North then lines(i,2) -= 1
                    if lines(i,4) = South then lines(i,2) += 1
                    if lines(i,4) = East then lines(i,1) += 1
                    if lines(i,4) = West then lines(i,1) -= 1
                end if
            next
            if map(lines(1,1),lines(1,2)) = 7 then lines(1,6) +=int(rnd*20)+10
            if map(lines(2,1),lines(2,2)) = 7 then lines(2,6) +=int(rnd*20)+10    
            if map(lines(1,1),lines(1,2)) < 5 and map(lines(1,1),lines(1,2)) <> 0 then lines(1,5) = Dead
            if map(lines(2,1),lines(2,2)) < 5 and map(lines(2,1),lines(2,2)) <> 0 then lines(2,5) = Dead
            for i = 1 to 2
                if lines(i,1) = 0 then lines(i,5) = Dead
                if lines(i,2) = 0 then lines(i,5) = Dead
                if lines(i,1) = 41 then lines(i,5) = Dead
                if lines(i,2) = 22 then lines(i,5) = Dead            
            next
            map(lines(1,1),lines(1,2)) = 1
            map(lines(2,1),lines(2,2)) = 2  
            lines(1,6) += 1
            lines(2,6) += 1        
            times(2) = timer
        elseif times(3) < timer - .4 then
            for i = 1 to 2
                if Lines(i,3) = Slow then
                    if lines(i,4) = North then lines(i,2) -= 1
                    if lines(i,4) = South then lines(i,2) += 1
                    if lines(i,4) = East then lines(i,1) += 1
                    if lines(i,4) = West then lines(i,1) -= 1
                end if
            next
            times(3) = timer
        end if
    END SUB

    SUB Keys(P$)
        if P$ = "w" then lines(1,4) = North
        if P$ = "s" then lines(1,4) = South
        if P$ = "d" then lines(1,4) = East
        if P$ = "a" then lines(1,4) = West
        if game = player2 then
            if P$ = "8" then lines(2,4) = North
            if P$ = "5" then lines(2,4) = South
            if P$ = "6" then lines(2,4) = East
            if P$ = "4" then lines(2,4) = West
        end if
    END SUB




    SUB Display.Boarder()
        for i = 1 to 42
            locate 1,i+9:color 7:print chr$(219)
            locate 23,i+9:color 8:print chr$(219)
            if i < 23 then
                locate i+1,10:color 7:print chr$(219)
                locate i+1,51:color 8:print chr$(219)
            end if
        next
    END SUB


    SUB Display.Map()
        for x = 1 to 40
            for y = 1 to 21
                locate y+1,x+10
                if map(x,y) = 1 then
                    color 9:print chr$(219)
                elseif map(x,y) = 2 then
                    color 12:print chr$(219)
                elseif map(x,y) = 3 then
                    color 7:print chr$(178)
                elseif map(x,y) = 4 then
                    color 7:print chr$(219)
                elseif map(x,y) = 5 then
                    color 7:print chr$(176)
                elseif map(x,y) = 6 then
                    color 7:print chr$(177)
                elseif map(x,y) = 7 then
                    color 10:print chr$(36)
                elseif map(x,y) = 8 then
                    color 4:print chr$(83)
                'else
                '    color 15:print chr$(219)
                end if
            next
        next
    END SUB

    SUB Put.Wall()
        if times(4) < timer - .25 then
            if Wallmem(1) = 0 then
                do
                    WallMem(2) = int(rnd * 40)
                    WallMem(3) = int(rnd * 21)
                loop until Map(WallMem(2),WallMem(3)) = 0
                Wallmem(1) = 4
                Map(WallMem(2),WallMem(3)) = 5
            elseif Wallmem(1) = 1 then
                Map(WallMem(2),WallMem(3)) = 4
            elseif Wallmem(1) = 2 then
                Map(WallMem(2),WallMem(3)) = 3
            elseif Wallmem(1) = 3 then
                Map(WallMem(2),WallMem(3)) = 6            
            end if
            Wallmem(1) = Wallmem(1) - 1
            times(4) = timer
        end if
    END SUB

    SUB Put.Bonus()
        if times(5) < timer - 10 then
            do
                bx = int(rnd * 40)
                by = int(rnd * 21)
            loop until Map(bx,by) = 0
            Map(bx,by) = 7
            times(5) = timer
        end if
    END SUB

    SUB AI()
        if map(lines(2,1),lines(2,2)-1) > 4 then lines(2,4) = North
        if map(lines(2,1),lines(2,2)+1) > 4 then lines(2,4) = South
        if map(lines(2,1)+1,lines(2,2)) > 4 then lines(2,4) = East
        if map(lines(2,1)-1,lines(2,2)) > 4 then lines(2,4) = West      
    END SUB

    SUB Display.Score()
        locate 1,1
        color 15
        print "PLAYER 1"
        color 7
        print "SCORE:"
        print str$(lines(1,6))
        print
        color 15
        print "PLAYER 2"
        color 7
        print "SCORE:"
        print str$(lines(2,6))
    END SUB


    I think I might make another one, time to have a look through my commodore 64 cassettes to find a game to rip Cheesy.

    PS. I'm not some old dude, I'm acually 17, despite having a C= and listen to Led Zeppelin.
    Logged
    Adigun A. Polack
    Ancient Guru
    ****
    Posts: 691



    WWW
    « Reply #11 on: December 30, 2005, 12:48:55 AM »

    To Nixon again:

    As for your entry there, it is a two-player nibbles-based game, which gives me this kinda old-skool feeling, which is a good start up front, man!  Wink

    And look, telling from what you said, it took you just 90 minutes for you to get that source code ready for this challenge.  Good job there!

    The one problem I found so far is that when the snake player moves in the *exact* opposite direction of where he/she is moving, then the other player automatically wins, which is something that you need to work on and fix a little bit, Nixon.  Other than that, I am officially accepting your entry!  Cheesy

    Also, like I said from the beginning, you can enter this challenge as many times as you like, so you are no doubt welcome to dig into your old Commodore 64 archives to give you an idea of what your next 90-min game is gonna be (and I wish you a lot of good fortune in coming up with a better one, at that!  Cheesy )!!

    With all of that in mind, be seeing you later, and thank you tonight!!!




    - Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Ryan
    Wandering Guru
    ***
    Posts: 338



    WWW
    « Reply #12 on: December 30, 2005, 01:14:02 PM »

    If I'm not mistaken, that's the way most nibbles games work because you're essentially turning back on yourself (much the same as if you circled around and ran into your side).  Good work, Nixon.  I can't imagine what you'd turn out with 90 minutes of Enya...
    Logged
    Nixon
    Member
    *
    Posts: 41



    WWW
    « Reply #13 on: December 31, 2005, 02:42:58 AM »

    Thanks Adigun A. Polack and Ryan, I think I aimed a bit to high on that game. Well after another 90 minutes have have made this

     
    Code:

    ' MINE FIELD
    ' BY NIXON
    ' My best(well only) score was 154 seconds, 128 moves

    DECLARE SUB Menu()
    DECLARE SUB Setup()
    DECLARE SUB Engine()
    DECLARE SUB EndGame(Dead)
    DECLARE SUB Make.Map()
    DECLARE SUB Display.Map()
    DECLARE SUB Display.Time()
    DECLARE SUB Display.Moves()
    DECLARE SUB Display.Mines()
    DECLARE SUB Engine.Keys(P$)
    DECLARE SUB Ontop.Mine()
    DECLARE SUB Instructions()
    DECLARE SUB Display.Boarder()

    screen 16,,,1

    Dim shared Map(40,25) as integer,Time.old as double,Moves.Taken as integer,_
                Player.x as integer,Player.y as integer, gameover as integer

    const North = 1
    const South = 2
    const East = 3
    const West = 4
    const FALSE = 0
    const TRUE = not FALSE
    const Mine = 1
    const NoTime = 2

    randomize timer

    menu


    ' - = = - - = = - - = = - - = = - =]  S U B S  [= - = = - - = = - - = = - - = = -

    SUB Menu()
        do
            cls
            color 15
            print "M I N E   F I E L D"
            print
            print "1) Play Game"
            print
            print "2) Instructions"
            print
            Print "3) Exit"
            do
                P$ = inkey$
            loop until P$ = "1" or P$ = "2" or P$ = "3"
            if P$ = "1" then call Setup():Call Engine()
            if P$ = "2" then Call Instructions()
            if P$ = "3" then end
        loop
       
    END SUB

    SUB Setup()
        Make.Map()
        Display.Boarder()
        Display.Map()
        Player.x = 1
        Player.y = 1
        Time.old = timer
        Engine.Keys(P$)
        Moves.Taken = 0
        gameover = FALSE
    END SUB

    SUB Engine()
        do
            P$ = inkey$
            if P$ <> "" then call Engine.Keys(P$)
            call Ontop.Mine()
            Display.Time
            Display.moves
            Display.mines
        loop until P$ = chr$(27) or gameover = TRUE
    END SUB

    SUB Ontop.Mine()
        if Map(Player.x, player.y) = 8 then Dead = Mine:call EndGame(Dead)
        if Map(Player.x, player.y) = 5 then Dead = FALSE:call EndGame(Dead)    
    END SUB

    SUB Make.Map()
        for x = 1 to 40
            for y = 1 to 22
                map(x,y) = int(rnd*3)+1
                if int(rnd*10) = 2 then Map(x,y) = 8
            next
        next
        map(1,1) = 1
        map(2,1) = 1
        map(1,2) = 1    
        map(37,19) = 5
    END SUB

    SUB Display.Map()
        for x = 1 to 40
            for y = 1 to 21
                locate y+1,x+1
                if map(x,y) = 1 then
                    color 2:print chr$(176)
                elseif map(x,y) = 2 then
                    color 2:print chr$(177)
                elseif map(x,y) = 3 then
                    color 2:print chr$(178)
                elseif map(x,y) = 4 then
                    color 10:print "$"
                elseif map(x,y) = 5 then
                    color 14:print chr$(35)
                elseif map(x,y) = 5 then
                    color 7:print "P"                
                elseif map(x,y) = 8 then
                    color 2:print chr$(int(rnd*2)+176)          
                else
                    color 15:print chr$(219)
                end if
            next
        next
    END SUB

    SUB Display.Time()
        time.since = Timer - Time.old
        Time.Left = 180 - Time.Since
        if Time.Left <=0 then Dead = NoTime: call EndGame(Dead)
        locate 7,45
        color 7
        print "Time Left:";Time.Left;"  "
    END SUB

    SUB Display.Moves()
        locate 1,45
        color 15
        print "M I N E   F I E L D"
        locate 3,45
        color 7
        print "Moves Taken:";Moves.Taken
    END SUB

    SUB Display.Mines()
        NumMines = 0
        if Map(player.x,player.y-1) = 8 then NumMines += 1
        if Map(player.x,player.y+1) = 8 then NumMines += 1
        if Map(player.x+1,player.y) = 8 then NumMines += 1
        if Map(player.x-1,player.y) = 8 then NumMines += 1  
        if Map(player.x-1,player.y-1) = 8 then NumMines += 1  
        if Map(player.x+1,player.y-1) = 8 then NumMines += 1
        if Map(player.x+1,player.y+1) = 8 then NumMines += 1
        if Map(player.x-1,player.y+1) = 8 then NumMines += 1    
        color 7
        locate 5,45
        print "Close Mines:"; NumMines
    END SUB

    SUB Engine.Keys(P$)
        locate player.y+1, player.x+1:color 0:print chr$(219)
        if P$ = "8" and player.y > 1 then Player.y -= 1:Moves.Taken += 1
        if P$ = "5" and player.y < 21 then Player.y += 1:Moves.Taken += 1
        if P$ = "6" and player.x < 40 then Player.x += 1:Moves.Taken += 1
        if P$ = "4" and player.x > 1 then Player.x -= 1:Moves.Taken += 1
        if P$ = "7" and player.x > 1 and player.y > 1 then Player.y -= 1:Player.x -= 1:Moves.Taken += 1
        if P$ = "9" and player.x < 40 and player.y > 1 then Player.y -= 1:Player.x += 1:Moves.Taken += 1
        if P$ = "1" and player.x > 1 and player.y < 21 then Player.y += 1:Player.x -= 1:Moves.Taken += 1
        if P$ = "3" and player.x < 40 and player.y < 21 then Player.y += 1:Player.x += 1:Moves.Taken += 1
       
        locate player.y+1, player.x+1:color 15:print chr$(2)
    END SUB

    SUB Display.Boarder()
        for i = 1 to 40
            locate 1,i+1:color 12:print chr$(196)
            locate 23,i+1:color 4:print chr$(196)
            if i < 22 then
                locate i+1,1:color 12:print chr$(179)
                locate i+1,42:color 4:print chr$(179)
            end if
        next
        locate 1,1:color 12:print "+"
        locate 1,42:color 12:print "+"
        locate 23,1:color 12:print "+"
        locate 23,42:color 4:print "+"
    END SUB

    SUB EndGame(Dead)
        cls
        if Dead = Mine then
            color 15
            print "YOU WALKED ON A MINE!"
        elseif Dead = NoTime then
            color 15
            print "YOU RAN OUT OF TIME!"        
        elseif Dead = FALSE then
            color 15
            print "YOU MADE IT THROUGH THE MINE FIELD"
            print "IN ONLY ";int(Timer - Time.old);" SECONDS"
            print "AND ONLY ";Moves.Taken;" MOVES"
        end if
        print:print:print
        print "Hit [Enter] to continue"
        do:P$ = inkey$:loop until P$ = chr$(13)
        Gameover = True
    END SUB

    SUB Instructions()
        cls
        Print "Keys"
        print "Use these to direct your player on the minefield."
        print "7 8 9 4 5 6 1 3"
        print
        print "game"
        print "must cross to the yellow # before time runs out"
        print "and without stepping on a mine."
        print
        print "Hit [Enter] to continue"
        do:P$ = inkey$:loop until P$ = chr$(13)
    END SUB


    I don't think is as good but I did have a working game quicker, which allowed me to do a little more work with menus and stuff. Theres another game which I want to make, it seemed quite popular in the last compo.

    Enjoy.

    Edit: I nearly forgot, I got the idea for this game from Mine Avoider released in 1996 by Amit Jain programmed in QB. Don't worry I didn't use any code from it Cheesy So much for a C= game.
    Logged
    Adigun A. Polack
    Ancient Guru
    ****
    Posts: 691



    WWW
    « Reply #14 on: December 31, 2005, 03:57:15 AM »

    To Nixon this morning:

    What do I think of your new game called Mine Field?  I am telling you that it is a hair-raising (and much better!!  Cheesy ) little one there, in that it reminds me of the game Minesweeper a bit — only that instead of using your mouse and clicking on things, you are *actually* using your character to navigate through the field littered with randomized mines that are waiting to spring their trap on you, all while trying to make it safely to that yellow pound sign ( # ), which takes a helluva lot of sheer skill and cleverness for you to master through!  Man, now THAT is old-skool gone into some splendid originality there, and I give you a lot of extra points on that there, Nixon!!!  (^_-)//

    Also, the fact that you added the “Close Mines” indicator really adds to the challenge and pressure of the game itself to let the player know of the dangers to deal with and overcome, and that there is a time limit as well, too, just to keep things interesting!  :cool:

    Overall, AWESOME JOB ON THIS, my man Nixon, and you are really shaping up into an excellent challenger here, you know that?  :king:  Your Mine Field entry is officially accepted from me!!

    Check you later with another game from you soon, if you are ready to lay it on me again!  Wink



    APPLAUDING YOUR EXCELLENT WORK HERE,


    Adigun Azikiwe Polack
    One of the Founders of “Aura Flow” ::: Continuing Developer of “Frantic Journey”
    Current Developer of “Star Angelic Slugger” ::: Webmaster of the “AAP Official Projects Squad”
    Original Creator of the “The New FreeBASIC 8-Bit Palette Machine” and “AFlib2 - Aura Flow Library 2”
    Logged

    url=http://dhost.hopto.org/aapproj/][/url]
    Your *official* home of the FreeBasic GFX Demo Central, now holding over 150 FB graphics demos so far!!!  Cheesy !
    Pages: [1] 2
      Print  
     
    Jump to:  

    Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!