locked
Fighting Game??? RRS feed

  • Question

  • Is it possible to make a very simple fighting game on small basic with stick figures, hp bar, punch and kick?

    'Stick Fighter
    'Graphics: Background, Floor, Lava, Water, Stickfigures, HP Bar, Timer, Walking, Punch, Kick, Guard
    'Controls: A = Punch
    '                  S = Guard
    '                 D = Kick
    '                 Move = Left and Right Arrow Key
    '                Jump = Up Arrow Key
    '                Go Down = Down Arrow Key
    'Math: HP is 100%
    '            ft = half a brick
    '             Punch does 10% dmg and is 5 ticks, can reach 3ft
    '             Kick does 15% dmg and is 8 ticks, can reach 5ft
    '             Guard negates all dmg, lasts for 2-3 seconds
    '            Lava does 100% dmg in 1 tick
    '            Water does 25% dmg every 2 ticks



    • Edited by Dinomite07 Wednesday, August 27, 2014 11:03 PM
    Tuesday, August 26, 2014 5:23 PM

Answers

  • Hello Dinomite07, 

    It looks like your program is missing some pieces that are essential for your game.

    1) Game Loop (updates your sprites that will create an animation)

    2) Arrays (Many variables under the same name) 

    3) Events (Assigning actions to keys) Ex) set arrow key left to move stick figure left

    By the looks of it, we'll need to start small. Let's focus on creating a stick figure that moves left and right. I also noticed that I am the only one replying in this post. It may be because your main question is a bit vague. Do you mind If I recreate a new post specifying this question: How to move a stick figure with arrow keys. That way you may get more posts. I'm new programming so we could learn some cool programming techniques. I would like to continue working with you to make this game. Please reply soon. 

    • Marked as answer by litdev Sunday, September 7, 2014 2:25 PM
    Wednesday, August 27, 2014 9:27 PM
  • Hello Dinomite07, 

    I recommend looking at a wiki page called "Small Basic: Resources for Game Programming". I read through it and noticed that there isn't anything for fighting games (well, from what I saw anyway). However, there is invaluable information about game programming techniques, design, examples, and sprite arrays. All of these are essential for a well written game. Until more help comes, I encourage you to study the basics of game programming and look at the samples offered there. You may be able to take some the coding techniques from the examples to create something that is like a fighting game. I hope this helps. 

    Resources for Game Programming:

    http://social.technet.microsoft.com/wiki/contents/articles/25689.small-basic-resources-for-game-programming.aspx


    • Proposed as answer by litdev Monday, September 1, 2014 6:25 PM
    • Marked as answer by litdev Sunday, September 7, 2014 2:24 PM
    Tuesday, August 26, 2014 11:31 PM
  • I remember having this problem too. 

    Here are a couple of solutions: 

    1) How did you get the parameter located in ImageList.LoadImage? The reason I ask is because I don't recognize the format for the image. I usually go to images, click on the image, right click on the image, select properties, select the security tab, then copy the object name (that should be near the top). It should look something like this: C:\Users\Ezra\Pictures\Grass Block.png. I may be wrong about this one though and your format may be correct. I would try it though.

    2) There is more than one way to input an image on the screen like: GraphicsWindow.DrawResizeImage() 

    3) Sometimes closing small basic and re-opening it will load the image 

    Was this image manipulated in anyway?

    Please let me know if any of these work. 

     


    • Edited by Ezra94 Wednesday, August 27, 2014 1:31 AM Reword
    • Marked as answer by litdev Sunday, September 7, 2014 2:24 PM
    Tuesday, August 26, 2014 11:59 PM

All replies

  • norman = ImageList.LoadImage("Computer\Local Disk(E:)\Nor Man\daddad.png")
    GraphicsWindow.DrawImage(norman,0,0)

    program would show up blank, background is white with no stick figure


    • Edited by Dinomite07 Tuesday, August 26, 2014 11:31 PM
    Tuesday, August 26, 2014 11:11 PM
  • Hello Dinomite07, 

    I recommend looking at a wiki page called "Small Basic: Resources for Game Programming". I read through it and noticed that there isn't anything for fighting games (well, from what I saw anyway). However, there is invaluable information about game programming techniques, design, examples, and sprite arrays. All of these are essential for a well written game. Until more help comes, I encourage you to study the basics of game programming and look at the samples offered there. You may be able to take some the coding techniques from the examples to create something that is like a fighting game. I hope this helps. 

    Resources for Game Programming:

    http://social.technet.microsoft.com/wiki/contents/articles/25689.small-basic-resources-for-game-programming.aspx


    • Proposed as answer by litdev Monday, September 1, 2014 6:25 PM
    • Marked as answer by litdev Sunday, September 7, 2014 2:24 PM
    Tuesday, August 26, 2014 11:31 PM
  • I remember having this problem too. 

    Here are a couple of solutions: 

    1) How did you get the parameter located in ImageList.LoadImage? The reason I ask is because I don't recognize the format for the image. I usually go to images, click on the image, right click on the image, select properties, select the security tab, then copy the object name (that should be near the top). It should look something like this: C:\Users\Ezra\Pictures\Grass Block.png. I may be wrong about this one though and your format may be correct. I would try it though.

    2) There is more than one way to input an image on the screen like: GraphicsWindow.DrawResizeImage() 

    3) Sometimes closing small basic and re-opening it will load the image 

    Was this image manipulated in anyway?

    Please let me know if any of these work. 

     


    • Edited by Ezra94 Wednesday, August 27, 2014 1:31 AM Reword
    • Marked as answer by litdev Sunday, September 7, 2014 2:24 PM
    Tuesday, August 26, 2014 11:59 PM
  • GraphicsWindow.Width = 900
    GraphicsWindow.Height = 500
    GraphicsWindow.BackgroundColor = "gray"
    Level()
    Sub Level
      
      man = ImageList.LoadImage("E:\LOLOLOL")
      brick = ImageList.LoadImage("E:\LOLOLOL")
      Shapes.AddImage(brick)
    endsub
      

    ok so the pictures are in my usb (e:) and in the folder lololol

    how would i add my brick image onto the screen like a row of them on the botton?

    Wednesday, August 27, 2014 12:38 AM
  • One way you would do this is by using a For Loop. I will create an example for you in a moment. I think . . . . Let me try first. I'll post an example if I am successful. 



    • Edited by Ezra94 Wednesday, August 27, 2014 1:23 AM Reword
    Wednesday, August 27, 2014 1:12 AM
  • it worked i was doing it wrong
    Wednesday, August 27, 2014 1:17 AM
  • Here is a rough example. Make sure you switch out the parameter in ImageList.LoadImage() with your block image. If you have any questions or if it doesn't work let me know. Also, If I improve the code I will let you know.  
    gh = 600 
    gw = 1200 
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    GraphicsWindow.Left = (Desktop.Width - gw) / 2
    GraphicsWindow.Top =  (Desktop.Height - gh) /4
    
    grassBlock = ImageList.LoadImage("C:\Users\Ezra\Pictures\Grass Block.png")
    
    For i = 1 To gw Step 50
      GraphicsWindow.DrawResizedImage(grassBlock,0,550,i+50,50)
    EndFor 

    Wednesday, August 27, 2014 1:26 AM
  • GraphicsWindow.Title = "FIGHT"
    gh = 600 
    gw = 1200 
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    GraphicsWindow.Left = (Desktop.Width - gw) / 2
    GraphicsWindow.Top =  (Desktop.Height - gh) /4
    background = ImageList.LoadImage("E:\LOLOLOL\background.jpg")
    brick = ImageList.LoadImage("E:\LOLOLOL\brick.png")
    r1 = ImageList.LoadImage("E:\LOLOLOL\1.gif")
    r2 = ImageList.LoadImage(":\LOLOLOL\2.gif")
    r3 = ImageList.LoadImage(":\LOLOLOL\3.gif")
    r4 = ImageList.LoadImage(":\LOLOLOL\4.gif")
    r5 = ImageList.LoadImage(":\LOLOLOL\5.gif")
    l1 = ImageList.LoadImage(":\LOLOLOL\11.gif")
    l2 = ImageList.LoadImage(":\LOLOLOL\22.gif")
    l3 = ImageList.LoadImage(":\LOLOLOL\33.gif")
    l4 = ImageList.LoadImage(":\LOLOLOL\44.gif")
    l5 = ImageList.LoadImage(":\LOLOLOL\55.gif")
    k1 = ImageList.LoadImage(":\LOLOLOL\k.gif")
    k2 = ImageList.LoadImage(":\LOLOLOL\kk.gif")
    p1 = ImageList.LoadImage(":\LOLOLOL\p.gif")
    p2 = ImageList.LoadImage(":\LOLOLOL\pp.gif")
    g1 = ImageList.LoadImage(":\LOLOLOL\g.gif")
    g2 = ImageList.LoadImage(":\LOLOLOL\gg.gif")
    Level()
    movement()
      
      Sub Level
        GraphicsWindow.DrawresizedImage(background , 0, 0, 1200, 1200)
        For i = 1 To gw Step 50
        GraphicsWindow.DrawResizedImage(brick,0+i, 575,50,50)
        EndFor
      endsub
    
    Sub movement
      
    endsub

    I am making a stick man got

    i can put it in but have no idea how to make it animated


    Wednesday, August 27, 2014 3:28 AM
  • I highly recommend checking this Small Basic Article. It includes a snippet of  code that animates a stick figure. It only walks though and it's an animation. However, the code included can be manipulated so you can assign keys to initiate the animation. Nonetheless, this gives you a start. I will keep you posted. Let me know if you've made any progress with this.

    Here's the article:

    http://blogs.msdn.com/b/smallbasic/archive/2014/05/20/draft-small-basic-featured-program-sidescroller.aspx

     

    • Edited by Ezra94 Wednesday, August 27, 2014 2:16 PM Reword
    Wednesday, August 27, 2014 4:33 AM
  • There is one more thing you need to know to create  an animation with your stick figures using key events. A game loop. If you aren't familiar with them then you may want to take a look at litdiv's wiki article on Small Basic Dynamic Graphics. In the article, he breaks down the process and explain the basic structure of a simple game. 

    Here's the article: 

    http://social.technet.microsoft.com/wiki/contents/articles/20865.small-basic-dynamic-graphics.aspx

    Wednesday, August 27, 2014 5:08 AM
  • looked at it and i do not understand it

    just trying to make my stick figure go left and right 

    left key goes left

    right key goes right


    • Edited by Dinomite07 Wednesday, August 27, 2014 5:20 PM
    Wednesday, August 27, 2014 5:11 PM
  • Hello Dinomite07,

    Could you please post your code and your stick figures? I'll look at it and see if I can find a solution. 

    Wednesday, August 27, 2014 7:54 PM
  • GraphicsWindow.Title = "Stick Fighter"
    gh = 600 
    gw = 1200 
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    GraphicsWindow.Left = (Desktop.Width - gw) / 2
    GraphicsWindow.Top =  (Desktop.Height - gh) /4
    background = ImageList.LoadImage("E:\LOLOLOL\background.jpg")
    brick = ImageList.LoadImage("E:\LOLOLOL\brick.png")
    r1 = ImageList.LoadImage("E:\LOLOLOL\1.gif")
    r2 = ImageList.LoadImage(":\LOLOLOL\2.gif")
    r3 = ImageList.LoadImage(":\LOLOLOL\3.gif")
    r4 = ImageList.LoadImage(":\LOLOLOL\4.gif")
    r5 = ImageList.LoadImage(":\LOLOLOL\5.gif")
    l1 = ImageList.LoadImage(":\LOLOLOL\11.gif")
    l2 = ImageList.LoadImage(":\LOLOLOL\22.gif")
    l3 = ImageList.LoadImage(":\LOLOLOL\33.gif")
    l4 = ImageList.LoadImage(":\LOLOLOL\44.gif")
    l5 = ImageList.LoadImage(":\LOLOLOL\55.gif")
    k1 = ImageList.LoadImage(":\LOLOLOL\k.gif")
    k2 = ImageList.LoadImage(":\LOLOLOL\kk.gif")
    p1 = ImageList.LoadImage(":\LOLOLOL\p.gif")
    p2 = ImageList.LoadImage(":\LOLOLOL\pp.gif")
    g1 = ImageList.LoadImage(":\LOLOLOL\g.gif")
    g2 = ImageList.LoadImage(":\LOLOLOL\gg.gif")
    Level()
    movement()
      
      Sub Level
        GraphicsWindow.DrawresizedImage(background , 0, 0, 1200, 1200)
        For i = 1 To gw Step 50
          GraphicsWindow.DrawResizedImage(brick,0+i, 575,50,50)
        EndFor
      endsub
      
      Sub movement
        GraphicsWindow.DrawImage(r1, 50 ,375)
      EndSub

    Wednesday, August 27, 2014 8:58 PM
  • Hello Dinomite07, 

    It looks like your program is missing some pieces that are essential for your game.

    1) Game Loop (updates your sprites that will create an animation)

    2) Arrays (Many variables under the same name) 

    3) Events (Assigning actions to keys) Ex) set arrow key left to move stick figure left

    By the looks of it, we'll need to start small. Let's focus on creating a stick figure that moves left and right. I also noticed that I am the only one replying in this post. It may be because your main question is a bit vague. Do you mind If I recreate a new post specifying this question: How to move a stick figure with arrow keys. That way you may get more posts. I'm new programming so we could learn some cool programming techniques. I would like to continue working with you to make this game. Please reply soon. 

    • Marked as answer by litdev Sunday, September 7, 2014 2:25 PM
    Wednesday, August 27, 2014 9:27 PM
  • It is certainly possible (but best to try some easier stuff first, getting used to SB) and Ezra94 is doing a grand job showing what is needed and I think working together on it is a great way to learn.  I'm sure others will chip in with ideas or suggestions along the way.

    Keep it up.

    Wednesday, August 27, 2014 9:47 PM
  • sure,

    btw if you want to help make the game with me

    gimme your gmail and we can share the folder in the drive

    so you can see the codes and pictures too

    Wednesday, August 27, 2014 9:51 PM
  • Hello Dinomite07 again, 

    I replied earlier on the basic structure of creating a game. I almost forgot that I have another rough sample that I have been working on. It's nowhere near completion but rather it's a prototype that takes advantage of loading an image and moving it by pressing the "Right" arrow key. There's no animation yet. Here's the code. 

    P.S. I will be adding on to this code so I keep you posted. Don't forget to switch out the parameter in "imageOne" with the image of your choice so you can see how it works. Let me know if you have any questions. 

    intialise()
    
    While "True" 
      updateGamePlay()
    EndWhile 
    
    Sub intialise 
      gw = 600 
      gh = 300
      GraphicsWindow.Width = gw 
      GraphicsWindow.Height = gh 
      GraphicsWindow.Left = (Desktop.Width - gw) / 2
      GraphicsWindow.Top = (Desktop.Height - gh) / 4
      
      GraphicsWindow.KeyDown = onKeyDown 
      
      keyDown = "False" 
      
      posX = 10
      imageOne = ImageList.LoadImage("C:\Users\Ezra\Pictures\walkR1.png")
      walkR1 = Shapes.AddImage(imageOne)
    EndSub
    
    Sub updateGamePlay 
      If (keyDown = "True") Then 
        Shapes.Move(walkR1,posX,0)
        keyDown = "False"
      EndIf 
    EndSub 
    
    Sub onKeyDown 
      lastKey = GraphicsWindow.LastKey 
      If (lastKey = "Right") Then 
        keyDown = "True" 
        posX = posX + 10
      EndIf
    EndSub 

    Wednesday, August 27, 2014 9:55 PM
  • Thank you for the kind words Litdiv. I couldn't have helped without using the wiki articles you've written. In a way, you're already helping out a lot. 
    Wednesday, August 27, 2014 9:57 PM
  • intialise()
    Level()
    While "True"
    updateGamePlay()
    EndWhile

    Sub intialise
     GraphicsWindow.Title = "Stick Fighter"
    gh = 600
    gw = 1200
    GraphicsWindow.Width = gw
    GraphicsWindow.Height = gh
    GraphicsWindow.Left = (Desktop.Width - gw) / 2
    GraphicsWindow.Top = (Desktop.Height - gh) / 4
    background = ImageList.LoadImage("E:\LOLOLOL\background.jpg")
    brick = ImageList.LoadImage("E:\LOLOLOL\brick.png")
    r1 = ImageList.LoadImage("E:\LOLOLOL\1.gif")
    r2 = ImageList.LoadImage("E:\LOLOLOL\2.gif")
    r3 = ImageList.LoadImage("E:\LOLOLOL\3.gif")
    r4 = ImageList.LoadImage("E:\LOLOLOL\4.gif")
    r5 = ImageList.LoadImage("E:\LOLOLOL\5.gif")
    l1 = ImageList.LoadImage("E:\LOLOLOL\11.gif")
    l2 = ImageList.LoadImage("E:\LOLOLOL\22.gif")
    l3 = ImageList.LoadImage("E:\LOLOLOL\33.gif")
    l4 = ImageList.LoadImage("E:\LOLOLOL\44.gif")
    l5 = ImageList.LoadImage("E:\LOLOLOL\55.gif")
    k1 = ImageList.LoadImage("E:\LOLOLOL\k.gif")
    k2 = ImageList.LoadImage("E:\LOLOLOL\kk.gif")
    p1 = ImageList.LoadImage("E:\LOLOLOL\p.gif")
    p2 = ImageList.LoadImage("E:\LOLOLOL\pp.gif")
    g1 = ImageList.LoadImage("E:\LOLOLOL\g.gif")
    g2 = ImageList.LoadImage("E:\LOLOLOL\gg.gif")
     
      GraphicsWindow.KeyDown = onKeyDown
     
      keyDown = "False"
     
      posX = 10
      posY = 10
      walkR1 = Shapes.AddImage(r1)
    EndSub

    Sub Level
        GraphicsWindow.DrawresizedImage(background , 0, 0, 1200, 1200)
        For i = 1 To gw Step 50
          GraphicsWindow.DrawResizedImage(brick,0+i, 575,50,50)
        EndFor
      endsub
     
    Sub updateGamePlay
      If (keyDown = "True") Then
        Shapes.Move(walkR1,posX,posY)
        keyDown = "False"
      EndIf
    EndSub

    Sub onKeyDown
      lastKey = GraphicsWindow.LastKey
      If (lastKey = "Right") Then
        keyDown = "True"
        posX = posX + 10
      EndIf
      If (lastKey = "Left") Then
        keyDown = "True"
        posX = posX - 10
      endif
      If (lastKey = "Up") Then
        keyDown = "True"
        posY = posY - 10
       endif
      if (lastKey = "Down") Then
        keyDown = "True"
        posY = posY + 10
      endif
    EndSub
    stick figure can move in all directions
    Wednesday, August 27, 2014 10:22 PM
  • Like I said before, we'll start off small by focusing on creating the controls for the stick figure. I'll create a new post. Do the images have transparent backgrounds? By the looks of it, it does but I want to make sure. Let me know when you've got my email. Thanks.

    • Edited by Ezra94 Wednesday, August 27, 2014 11:01 PM Reword
    Wednesday, August 27, 2014 10:23 PM
  • yes they all have transparent backgrounds

    now we need gravity so the stick figure can drop down onto the bricks


    • Edited by Dinomite07 Wednesday, August 27, 2014 10:44 PM
    Wednesday, August 27, 2014 10:35 PM
  • I got your email. I hope that all the examples I post will include them. If they don't work or if I have trouble accessing them I will let you know. I have few stick figures myself so I may use them instead. We could always switch out the characters and work out the details later. Now, we need to focus on controls. Gravity is a cool consideration and It'll make your game more realistic but maybe we should focus on the code first? Remember small steps. Please, take a look at some of the previous replies on this post. I've included some code and resources that will help make this simple game. While you are doing so, I will create the new post. 

    Wednesday, August 27, 2014 10:59 PM
  • so there is an input lag

    i go right 3 times

    but when i go down it goes right i press down again and it goes down

    Wednesday, August 27, 2014 11:25 PM
  • Okay, I created the new post it's called: How to Create a Sprite Animation with Key Events. Feel free to input your questions or respond to any replies we get in that post. We going to focus on getting our stick figure to move first. Also, I think it would be efficient if we create a separate post every time we have a new goal in mind so we could work in small chunks. I am going to continue experimenting with code. Let me know if you are okay with this plan of action and have made any progress. 

    Wednesday, August 27, 2014 11:27 PM
  • im ok

    side scroller in drive in (folder Fight)


    • Edited by Dinomite07 Wednesday, August 27, 2014 11:36 PM
    Wednesday, August 27, 2014 11:27 PM
  • The sprites are in the folder Fight? Correct? Let's keep an eye on the new post. It may take a while before we get any replies. As for the example, I'll take a look at it and rework it. To make development easier, can you give me the names of the stick figure sprites that are just for walking. When we produce examples, it's best just to include the walking sprites for now. 
    • Edited by Ezra94 Wednesday, August 27, 2014 11:51 PM Reword
    Wednesday, August 27, 2014 11:49 PM
  • um folder Fight contains a different program with different sprites

    my sprites are in the main folder

    http://social.msdn.microsoft.com/Forums/en-US/47e2b002-9020-4abe-9509-ac58653fa5e9/how-to-create-a-sprite-animation-with-key-events?forum=smallbasic

    make sure i dont lose access to the sprite forum

    • Edited by Dinomite07 Thursday, August 28, 2014 12:50 AM
    Thursday, August 28, 2014 12:18 AM