none
Run Soldier Dude - Installer/Updater, Level Editor, and the Game! === Final! === RRS feed

  • General discussion

  • Here's the latest updates. I think I'm pretty much done, If I make long levels (more than 300 wide) the program starts to slow down. I think I hit the limits of SmallBasic arrays. The solution, make alot of short levels. I did put a lot of error checking in the level editor and added water to the bottom of the screen! Made a new installer program that loads nearly 50 files and can update the game to the latest version if any, including graphics, each time you run it.

    I need challenging levels to put in the game. Post the data from your level.txt file below. We can give them a try. When we get a few levels, I will try to put them in order from least challenging to most challenging levels, then include them in the next version for Installing/Updating.

    'Soldier Installer  ----  By Krueg -- 2012
    '   ATTENTION! You MUST save this program first so the downloaded files end up in the right place!
    '   Choose an empty folder named something like "Soldier" and save this program as "SoldierLoader.sb"
    '   All files will end up in the folder this program runs in.
    TextWindow.Left = 20
    TextWindow.Top  = 10
    TextWindow.ForegroundColor = "Red"
    TextWindow.WriteLine("  ----  ATTENTION!  ----")
    TextWindow.WriteLine("If you did not save this program then close it!")
    TextWindow.WriteLine("Save it in an empty folder! Then run again. Press ENTER to start!")
    TextWindow.Read()
    TextWindow.ForegroundColor = "Yellow"
    TextWindow.WriteLine("")
    TextWindow.WriteLine("Downloading File List...")
    LocalPath = Program.Directory + "\"
    WebPath = "http://krueg.com/sb/soldier/"
    TempFile = Network.DownloadFile(WebPath + "filelist.txt")
    FileList = File.ReadContents(TempFile)
    ArrayCount = Array.GetItemCount(FileList)
    For i = 1 to ArrayCount
      TextWindow.ForegroundColor = "White"
      TextWindow.WriteLine("Downloading: " + WebPath + FileList[i] + " <-- ")
      TempFile = Network.DownloadFile(WebPath + FileList[i])
      SaveName = ""
      Length = Text.GetLength(FileList[i])
      For i2 = 1 To Length
        Letter = Text.GetSubText(FileList[i],i2,1)
        If Letter = "/" Then
          SaveName = SaveName + "\"
        Else
          SaveName = SaveName + Letter
        EndIf
      EndFor
      TextWindow.Write("Saving: " + SaveName + " -->  ")
      Flag = File.CopyFile(TempFile,LocalPath + SaveName)
      If Flag = "FAILED" Then
        TextWindow.ForegroundColor = "Red"
      Else
        TextWindow.ForegroundColor = "Green"
      EndIf
      TextWindow.WriteLine(Flag)
    EndFor
    TextWindow.ForegroundColor = "Yellow"
    TextWindow.WriteLine("Done!")
    TextWindow.ForegroundColor = "Green"
    TextWindow.WriteLine("")
    TextWindow.WriteLine("Open/Run soldier.sb to play the game!")
    TextWindow.WriteLine("Open/Run soldiereditor.sb to make your own levels!")
    TextWindow.WriteLine("")


    • Edited by JKrueg Sunday, August 19, 2012 4:27 PM
    Monday, August 13, 2012 2:31 AM

All replies

  • 'Well I just finished my level creator. Here it is. sorry it took so long. BTW AmAzing game!!

    '====================================================================
    '=======================Level Creator built by Zock77, age 14. Started Aug 2012======
    '=======================For levels to "RUN Little solder dude, RUN!" By Krueg=======
    '====================================================================

    path = "http://krueg.com/sb/soldier/"
    LevelEditDebug = "Yes"
    version = .02
    Section = 1
    Backgroundimg = ImageList.LoadImage(path + "background.png")

    GraphicsWindow.MouseMove = MouseMove
    GraphicsWindow.MouseDown = MouseDown
    Controls.ButtonClicked = ButtonClicked


    GraphicsWindow.BrushColor = "Black"
    GraphicsWindow.Width =  800
    GraphicsWindow.Height = 672
    GraphicsWindow.CanResize = "No"
    GraphicsWindow.DrawResizedImage(Backgroundimg,0,0,GraphicsWindow.Width,GraphicsWindow.Height)
    GraphicsWindow.Top = 5
    GraphicsWindow.Left = 20
    GraphicsWindow.Title = "Level Creator " + version + " For ''RUN little Soldier Dude, RUN!'' By Krueg. Made By Zock77."



    img1 = ImageList.LoadImage(path + "5brickred.png")
    img2 = ImageList.LoadImage(path + "5ground.png")
    img3 = ImageList.LoadImage(path + "signright.png")
    img4 = ImageList.LoadImage(path + "arch.png")
    img5 = ImageList.LoadImage(path + "starblue.png")
    img6 = ImageList.LoadImage(path + "signleft.png")
    img7 = ImageList.LoadImage(path + "5brickblue.png")
    img8 = ImageList.LoadImage(path + "spikered.png")
    img9 = ImageList.LoadImage(path + "5brickgreen.png")
    img10 = ImageList.LoadImage(path + "starred.png")
    img11 = ImageList.LoadImage(path + "5brickbrown.png")
    img12 = ImageList.LoadImage(path + "spikegreen.png")
    img13 = ImageList.LoadImage(path + "heart.png")

    ArrowcountLeft = 102
    BlueStarCount = 51
    doorcount = 119
    Arrowcount = 101
    GroundBrickCount = 41
    BrickRedCount = 31
    BrickBlueCount = 11
    SpikeRedcount = 91
    BrickGreenCount = 21
    RedStarcount = 61
    BrownBrickCount = 1
    Greenspikecount = 81
    HeartCount = 71

    AddButtons()




      '--------------------------bricks[1-9]  are brown bricks                              star[51-59] are blue stars                  icon[101] is the sign pointing right
      '--------------------------bricks[11-19]  are blue bricks                               star[61-69] are red stars                   icon[102] is the sign pointing left
      '--------------------------bricks[21-29]  are green bricks                           spike[81-89] are green spikes
      '--------------------------bricks[31-39]  are red bricks                               spike[91-99] are red spikes                icon[118] 1up icon
      '--------------------------ground[41-49]  are ground images                   Hearts are [71-79]                                icon[119] door to next level

    '====================================================================
    '============================Subroutines===============================
    '====================================================================


    Sub ButtonClicked
      If Controls.LastClickedButton = BrickRed Then
        If BrickRedCount <= 39 Then
    Count = BrickRedCount
    BrickRedCount = BrickRedCount + 1
    Objectmove = Shapes.AddImage(img1)
    Type = "Brick"
      EndIf
      EndIf
      If Controls.LastClickedButton = GroundBrick Then
        If GroundBrickCount <= 49 Then
               Count = GroundBrickCount
          GroundBrickCount = GroundBrickCount + 1
        Objectmove = Shapes.AddImage(img2)
        Type = "Brick"
        EndIf
      EndIf
     
        If Controls.LastClickedButton = BrickBlue Then
        If BrickBlueCount <= 19 Then
               Count = BrickBlueCount
          BrickBlueCount = BrickBlueCount + 1
        Objectmove = Shapes.AddImage(img7)
        Type = "Brick"
        EndIf
      EndIf
     
          If Controls.LastClickedButton = GreenBrick Then
        If BrickGreenCount <= 29 Then
               Count = BrickGreenCount
          BrickGreenCount = BrickGreenCount + 1
        Objectmove = Shapes.AddImage(img9)
        Type = "Brick"
        EndIf
      EndIf
     
            If Controls.LastClickedButton = BrownBrick Then
        If BrownBrickCount <= 9 Then
               Count = BrownBrickCount
         BrownBrickCountt = BrownBrickCount + 1
        Objectmove = Shapes.AddImage(img11)
        Type = "Brick"
        EndIf
      EndIf
     
      If Controls.LastClickedButton = Rightarrow Then
        If Arrowcount = 101 Then
        Objectmove = Shapes.AddImage(img3)
        Type = "Object"
        Count = Arrowcount
        Arrowcount = Arrowcount + 1
        EndIf
      EndIf
      If Controls.LastClickedButton = Nextlevdoor Then
        If Doorcount = 119 Then
           Objectmove = Shapes.AddImage(img4)
        Type = "Door"
        Count = Doorcount
        Doorcount = Doorcount + 1
      EndIf
    EndIf
      If Controls.LastClickedButton = StarBlue Then
        If BlueStarCount <= 59 Then
        Objectmove = Shapes.AddImage(img5)
        Type = "Object"
        Count = BlueStarCount
        BlueStarCount = BlueStarCount + 1
        EndIf
      EndIf
        If Controls.LastClickedButton = RedStar Then
        If RedStarcount <= 69 Then
        Objectmove = Shapes.AddImage(img10)
        Type = "Object"
        Count = RedStarcount
        RedStarcount = RedStarcount + 1
        EndIf
      EndIf
        If Controls.LastClickedButton = RedSpike Then
        If SpikeRedcount <= 99 Then
        Objectmove = Shapes.AddImage(img8)
        Type = "Object"
        Count = SpikeRedcount
        SpikeRedcount = SpikeRedcount + 1
        EndIf
      EndIf
          If Controls.LastClickedButton = Heart Then
        If Heartcount <= 79 Then
        Objectmove = Shapes.AddImage(img13)
        Type = "Object"
        Count = Heartcount
        Heartcount = Heartcount + 1
        EndIf
      EndIf
          If Controls.LastClickedButton = GreenSpike Then
        If Greenspikecount <= 89 Then
        Objectmove = Shapes.AddImage(img12)
        Type = "Object"
        Count = Greenspikecount
        Greenspikecount = Greenspikecount + 1
        EndIf
      EndIf
      If Controls.LastClickedButton = Leftarrow Then
        If ArrowcountLeft = 102 Then
        Objectmove = Shapes.AddImage(img6)
        Type = "Object"
        Count = ArrowcountLeft
        ArrowcountLeft = ArrowcountLeft + 1
        EndIf
      EndIf
     
      If Controls.LastClickedButton = Sec2 Then
        If Section <> 4 Then
          Section = Section + 1
          GraphicsWindow.Clear()
          GraphicsWindow.DrawResizedImage(Backgroundimg,0,0,GraphicsWindow.Width,GraphicsWindow.Height)
          AddButtons()
          Controls.SetButtonCaption(Sec2,"Go to Section " + (Section + 1))
        EndIf
      EndIf
      If Section = 4 Then
      Controls.SetButtonCaption(Sec2,"Go to Section 4")
      EndIf
     
      If Controls.LastClickedButton = Help Then
        ShowHelptext()
        EndIf
    EndSub

    '====================================================================
    '====================================================================

    Sub MouseMove
      If Type = "Brick" Then
      MouseXRounded = Math.Round(GraphicsWindow.MouseX / 32) * 32
      MouseYRounded = (Math.Round(GraphicsWindow.MouseY / 134.4) * 134.4) - 32
    ElseIf Type = "Object" Then
        MouseXRounded = Math.Round(GraphicsWindow.MouseX / 32) * 32
        MouseYRounded = (Math.Round(GraphicsWindow.MouseY / 134.4) * 134.4) - 64
      EndIf
      If Type = "Door" Then
            MouseXRounded = Math.Round(GraphicsWindow.MouseX / 32) * 32
            MouseYRounded = (Math.Round(GraphicsWindow.MouseY / 134.4) * 134.4) - 130
            EndIf
      Shapes.Move(Objectmove,MouseXRounded,MouseYRounded)
    EndSub

    '====================================================================
    '====================================================================

    Sub MouseDown


    Objectmove = ""

      LevelX = Math.Round(Math.Round(GraphicsWindow.MouseX / 32))

      If Section = 2 Then
        LevelX = LevelX + Math.Round(GraphicsWindow.Width / 32)
      ElseIf Section = 3 Then
        LevelX = LevelX + Math.Round((GraphicsWindow.Width * 2) / 32)
      ElseIf Section = 4 Then
        LevelX = LevelX + Math.Round((GraphicsWindow.Width * 3) / 32)
        EndIf
      Level = Math.Ceiling(MouseYRounded / 134.4)
      If Level = 1 Then
        pf1 = pf1 + LevelX + "=" + Count + ";"
            EndIf

        If Level = 2 Then
        pf2 = pf2 + LevelX + "=" + Count + ";"
      EndIf
        If Level = 3 Then
        pf3 = pf3 + LevelX + "=" + Count + ";"
      EndIf
        If Level = 4 Then
        pf4 = pf4 + LevelX + "=" + Count + ";"
      EndIf
        If Level = 5 Then
        pf5 = pf5 + LevelX + "=" + Count + ";"
      EndIf
     
      If LevelEditDebug = "Yes" Then
        TextWindow.Clear()
        TextWindow.Left = 900
          TextWindow.WriteLine("LevelX = " + LevelX)
          TextWindow.WriteLine("Section = " + Section)
          TextWindow.WriteLine("Level = " +  Level)
          TextWindow.WriteLine("Count = " +  Count)
      EndIf
      End:
      If Mouse.IsRightButtonDown = "True" Then
        Save()
      EndIf
     
    EndSub


    '====================================================================
    '====================================================================


    Sub Save
       TextWindow.WriteLine("pf1 = " +  pf1)
        TextWindow.WriteLine("pf2 = " +  pf2)
        TextWindow.WriteLine("pf3 = " +  pf3)
        TextWindow.WriteLine("pf4 = " +  pf4)
        TextWindow.WriteLine("pf5 = " +  pf5)
        ask:
        TextWindow.Write("Enter Your save Directory: ")
            Directory = TextWindow.Read()
        File.CreateDirectory(Directory)
       Files = File.GetFiles(Directory)
        If Files = "" Then
          TextWindow.WriteLine("There are no .txt files in this directory, Please try again")
          Goto ask
        EndIf
        TextWindow.WriteLine("These are the files in this directory.")
        TextWindow.WriteLine("     --     ")
        TextWindow.WriteLine(Files)
        TextWindow.WriteLine("     --     ")
        TextWindow.WriteLine("Enter your txt name")
        Name = TextWindow.Read()
        

         File.WriteLine(Directory + "/" + Name,1,"pf1 = " +  pf1)

        File.WriteLine(Directory + "/" + Name,2,"pf2 = " + pf2)

        File.WriteLine(Directory + "/" + Name,3"pf3 = " + pf3)

       File.WriteLine(Directory + "/" + Name,4,"Pf4 = " + pf4)

         File.WriteLine(Directory + "/" + Name,5,"pf5 = " + pf5)
        
        
        
        For ii = 1 To 3
          Loading = "Loading"
          For ii = 1 To 3
            Program.Delay(200)
          Loading = Loading + "."
          TextWindow.Clear()
          TextWindow.WriteLine(Loading)
          EndFor
        EndFor
          
      TextWindow.WriteLine("Done")
     

    EndSub

    '====================================================================
    '====================================================================

    Sub AddButtons
     
    Sec2 = Controls.AddButton("Go to Section " +  (Section + 1) ,380,90)
     
    BrickRed = Controls.AddButton("Add Red Brick",10,10)

    GroundBrick = Controls.AddButton("Add Ground Brick",120,10)

    Rightarrow = Controls.AddButton("Add Right Arrow",250,10)

    Nextlevdoor = Controls.AddButton("Add Door",375,10)

    StarBlue = Controls.AddButton("Add Blue star",460,10)

    LeftArrow = Controls.AddButton("Add Left Arrow",570,10)

    BrickBlue = Controls.AddButton("Add Blue Brick",690,10)

    Help = Controls.AddButton("Help",390,50)

    RedSpike = Controls.AddButton("Add Red Spike",10,50)

    GreenBrick = Controls.AddButton("Add Green Brick",120,50)

    RedStar = Controls.AddButton("Add Red Star",260,50)

    BrownBrick = Controls.AddButton("Add Brown Brick",460,50)

    Greenspike = Controls.AddButton("Add green spike",589,50)

    Heart = Controls.AddButton("Add heart",710,50)
    EndSub
     
      '==================================================================
      '==================================================================
     
      Sub ShowHelptext
        TextWindow.Clear()
        TextWindow.WriteLine("     --")
        TextWindow.WriteLine("To Add a brick, click the add brick button")
        TextWindow.WriteLine("     --")
        TextWindow.WriteLine("To change sections, click the Go to section button")
        TextWindow.WriteLine("     --")
        TextWindow.WriteLine("To save, Right click")
        Program.Delay(7000)
        TextWindow.Hide()
      EndSub
     
      '==================================================================
      '==================================================================
     
     


    Zock77


    Monday, August 13, 2012 3:52 PM
    Answerer
  • Wow! AMAZING level editor! I love how you can draw and drop objects!

    -Noah J. Buscher "Nothing is Impossible Until Proven Impossible."

    Monday, August 13, 2012 11:13 PM
  • Thanks, it's got some bugs that have got me stumped. I also realized the start position in the game comes from the position your at in the level editor when you save. I should come up with a help screen and some fine tuning tweeks, like the way it doubles up on images. Anyhow it sure is faster creating a level!


    • Edited by JKrueg Tuesday, August 14, 2012 12:38 AM
    Tuesday, August 14, 2012 12:37 AM
  • Pretty much done working on this one. It took me about 3 months (in my spare time) just to create the game. Copy the code at the top and paste it into SmallBasic. SAVE THE PROGRAM to an empty folder, this is where everyhing is installed when the program is run.

    After installing, open "soldier.sb" in SmallBasic and enjoy the game.

    If you want to create your own levels then open "soldiereditor.sb" and check out the directions on the opening screen.

    I hope you all enjoy this as much as I enjoyed creating it!

    Sunday, August 19, 2012 3:10 PM
  • I LOVE your game!! nice water!

    One thing that is impossible is impossible no matter if it is proven so first.

    Sunday, August 19, 2012 3:23 PM
    Answerer