locked
Flappy Birds RRS feed

  • General discussion

  • How about a 'flappy birds' clone for SB.  Perhaps a team challenge?  We had a couple before and produced some great work.

    Anyone interested collaborating on it in groups of 2 or 3?

    Tuesday, February 11, 2014 7:44 PM

All replies

  • You can count me in :D

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Tuesday, February 11, 2014 8:38 PM
    Answerer
  • @Zock77 Great

    We need all sorts of skills: graphics, game design, movement coding, testing, intro screen, high score management etc.  A good game is much more than just code, it takes imagination.

    Tuesday, February 11, 2014 10:15 PM
  • Do i get a team? :lol:

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Wednesday, February 12, 2014 4:47 PM
    Answerer
  • I've found out Flappy Bird remixes for Scratch! Why not just adapt them to SB?  ;-)

    scratch.mit.edu/projects/16743509/

    scratch.mit.edu/projects/17831296/


    Click on "Propose As Answer" if some post solves your problem or "Vote As Helpful" if some post has been useful to you! (^_^)

    Wednesday, February 12, 2014 11:53 PM
    Answerer
  • you should be part of a team!


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Thursday, February 13, 2014 4:13 AM
    Answerer
  • Soo, Am i making it by myself or am I competing in a team?


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Thursday, February 13, 2014 6:49 PM
    Answerer
  • Maybe on your own, perhaps there will be some late-comers.  I'll write one too.
    Thursday, February 13, 2014 7:45 PM
  • I'll help out Zock in this endeavor of glory.

    Cobra355~

    Thursday, February 13, 2014 7:53 PM
  • I'll help out Zock in this endeavor of glory.

    Cobra355~


    Cool.

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Thursday, February 13, 2014 8:15 PM
    Answerer
  • Hello SB dev team.

    I'm really engrossed in something atm, but in the spirit of things I might have a contribution.

    To the game designer and publisher: what classic example of design, but I couldn't get past level 3.

    Also if you want a drop-menu, I've got one in my library. Extensible and too easy to customise. It's in a game loop structure. I'll post it soon. It's doesn't slow the loop down much. Still untested.

    You might want a home page that manages and displays your scores, help stuff, welcome and whatever. It creates an non async event OnMenuClicked.

    Zock or litdev it's yours to use if it fits the design.




    • Edited by Jibba j Friday, February 14, 2014 6:18 AM
    Friday, February 14, 2014 6:09 AM
  • Ok. I'll post this menu code and you can use it if it suits. I built it for my own library for an applet I'm gunna build.

    It's 350 lines but the bulk of it can be copied and pasted at the bottom. It's not fully tested. Packs some features including easy to customise and can run with or without sprites. All native and all relevant variables contain the word "menu".

    To customise all you have to do is modify the following and the rest is calculated:

    Sub MenuDataTable   'USE THIS SUB TO CUSTOMISE MENU
      'MENU   
      'Data Table
      menu = "1=View Screen;2=Program;3=Help;4=Test This"  '<<<<<<<<<ADD DATA
      menuWidth = "1=105;2=85;3=55;4=85"  '<<<<<<<<<<<<<<<<MATCH WIDTH WITH DATA
      subMenu[1] = "1=Home;2=Small;3=Leaders Board;4=Extra for one;5=Another Extra for testing submenu one" 
      subMenu[2] = "1=Debug;2=Close;3=test submenu two;4=more again" 
      subMenu[3] = "1=How;2=About Match Picture;3=Again test me" 
      subMenu[4] = "1=Test One;2=Test Sub Menu two"
      subMenuWidth = "1=285;2=145;3=165;4=155"   '<<<<<<<<<MATCH WIDTH WITH DATA
    EndSub

    And a pic:

    Here's the source code: BGF911  and here's a link to exe zip on my Skydrive:  http://1drv.ms/1buyjbS

    I hope you run the zip version and let me what you think.

    I'm reluctant to team up as I can't reliably commit to much atm (snowed under). However I'm open to maybe posting some stuff or whatever on the forum. I might do a welcome screen to test out the menu. I'll post anything I do and the SB dev team can help themselves. Sort of casual collaboration.


    • Edited by Jibba j Friday, February 14, 2014 12:46 PM
    Friday, February 14, 2014 12:44 PM
  • Hi LitDev,

    Maybe i'll post it here because of new LDFastShapes Object in LitDev.dll v99. Here's german XML LitDevDe.xml v1.0.0.99.  (btw. new DocumentViewer  looks really great).

    And ... maybe someone's interested in NETReflector 6 for free

    Friday, February 14, 2014 10:06 PM
    Answerer
  • I'm going to use extensions for this. Hope that's ok. First time I've used them.

    Also I might go alone so I can try some stuff, or do you think i'll learn more teaming up?

    Friday, February 14, 2014 10:25 PM
  • Well usually on a team one person does all the coding and everyone else just hangs out. (At least with my experience) So I think you will probably learn the most if you write your own and then see what everyone else solutions were.

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Friday, February 14, 2014 10:50 PM
    Answerer
  • @ GotoLoop. Are you going to join?

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Friday, February 14, 2014 10:57 PM
    Answerer
  • This is awesome... top idea litdev, thanks. MAD
    • Edited by Jibba j Saturday, February 15, 2014 7:09 PM MAD
    Saturday, February 15, 2014 7:04 PM
  • What is the date for posting the products?


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, February 16, 2014 5:12 PM
    Answerer
  • Also, Jibba Jabba. Would you mind teaming up with me and making the menu for my game? I've completed the actual game just not the menu stuff.

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Sunday, February 16, 2014 5:16 PM
    Answerer
  • What is the date for posting the products?

    Say next weekend 22-23 Feb?

    Sunday, February 16, 2014 5:20 PM
  • Hi Zock, sure, i'll try to. I'll just need a bit of time to test how the menu builds in. Could be tricky, don't know. In the mean time you can try it out yourself. I'm a slow coder I think.

    I like this flappy duck game design so much that I'm going to build a wide screen deluxe version. One where I can get a higher score than 3. Might spend a month or 2 on this one.

    Will aim to have something for next weekend though.




    • Edited by Jibba j Tuesday, March 4, 2014 2:43 AM agif
    Monday, February 17, 2014 5:23 AM
  • Feel free to use this as a starting point.  Crashes quite a bit, let me know if you can figure out why.  I used this to show my students how easy it was to create that game.

    GraphicsWindow.Width = 640
    GraphicsWindow.Height = 480
    GraphicsWindow.CanResize = "False"
    GraphicsWindow.MouseDown = OnMouseDown
    GraphicsWindow.MouseUp = OnMouseUp
    Timer.Tick = OnTimerTick
    Timer.Interval = 50 ' This is how often the Timer.Tick subroutine will be called 30fps
    checkforvertical = 0
    gameover = 0
    score = 0
    t=0
    h=0
    x=0
    v=70 'Upward Velocity
    g=50 'Gravity
    ballsize = 56
    currentheight = 320
    windowheight = GraphicsWindow.Height
    rectanglewidth = 50
    gap = 200

    setup()

    ball=Shapes.AddEllipse(ballsize,ballsize)
    Shapes.Move(ball,200,320)

    'ball = Shapes.AddImage(Program.Directory+"/images/marioD.png")



    Sub setup

      checkforvertical = 0
      rectanglex = 650   ' Set the rectangle to be at the right side of the screen
      rectangleheight = Math.GetRandomNumber(windowheight)     ' Get a random y value to determine the height

      If rectangleheight > 400 Then  ' If the height is too high, reset it to 380
        rectangleheight = 380
      EndIf
      rectangley = windowheight - rectangleheight ' 
      rectangletop_height = windowheight-rectangleheight-gap
      rectangletop = Shapes.AddRectangle(25, rectangletop_height )
      Shapes.Move(rectangletop, 650,0)
      rectanglebottom = Shapes.AddRectangle(25,rectangleheight)
      Shapes.Move(rectanglebottom, 650, rectangley)
      topboundry = Shapes.GetTop(rectanglebottom)-gap
      bottomboundry = Shapes.GetTop(rectanglebottom) 

    EndSub

    Sub OnTimerTick
      If gameover=0 Then
        t = t + .1
        h = windowheight - (-1*.5*g*t*t+v*t+currentheight) 
        rectanglex = rectanglex - 5
        Shapes.Move(rectanglebottom, rectanglex, rectangley)
        Shapes.Move(rectangletop, rectanglex, 0)
        If rectanglex <= 0 Then 
          rectanglex = 650   
          Shapes.Remove(rectanglebottom)
          Shapes.Remove(rectangletop)
          setup()
        EndIf
      EndIf

      If h >= 475 And gameover=0 Then
        gameover = 1
        GraphicsWindow.ShowMessage("Game Over!  You hit the bottom!", "Game Over") 
        Program.End()
      ElseIf h<=-10 And gameover=0 Then
        gameover = 1
        GraphicsWindow.ShowMessage("Game Over!  You hit the top!", "Game Over")  
        Program.End()
      Else
        collision()
        Shapes.Move(ball,200,h) 
      EndIf
    EndSub

    Sub collision
      ballleftC = Shapes.GetLeft(ball)
      ballrightC = Shapes.GetLeft(ball) + 25
      rectangleleftC = Shapes.GetLeft(rectanglebottom)
      rectanglerightC = Shapes.GetLeft(rectanglebottom)+25
      balltop = Shapes.GetTop(ball)
      ballbottom = Shapes.GetTop(ball) + ballsize

      If (ballrightC>rectangleleftC) AND (ballleftC<rectanglerightC) Then
        checkforvertical = 1
      Else
        checkforvertical = 0
      EndIf
      If checkforvertical = 1 AND gameover = 0 Then
        If balltop <= topboundry AND gameover = 0 Then
          gameover = 1
          GraphicsWindow.ShowMessage("Game Over!  You hit the top of the wall!", "Game Over") 
          Program.End()     
        ElseIf ballbottom >= bottomboundry AND (gameover = 0) Then
          gameover = 1
          GraphicsWindow.ShowMessage("Game Over!  You hit the bottom of the wall!", "Game Over") 
          Program.End()
        Else
          checkforvertical = 0
          'score = score + 1
          'GraphicsWindow.Title="Score: " + score
        EndIf   
      EndIf
    EndSub

    Sub OnMouseDown
      'Shapes.Remove(ball)
      ' ball=Shapes.AddImage(Program.Directory+"\images\marioD.png")
      If Mouse.IsLeftButtonDown Then
        currentheight = windowheight - h
        Shapes.Move(ball, 200, h)
        t=0
      EndIf

    EndSub

    Sub OnMouseUp
      'Shapes.Remove(ball)
      ' ball=Shapes.AddImage(Program.Directory+"\images\marioU.png")
      Shapes.Move(ball,200,h)
    EndSub

              
    Tuesday, February 18, 2014 7:26 PM
  • Hi Mrgillrchs

    When you get those error reports the clue is in the 1st couple of lines, below that they're contain other flow on stuff.

    Yours reported a skip visibility check which indicates that something was unable to produce a visible return.

    In this case a shape (rectangle) of negative size (height) was being added.'

    ' '============================================================
      'bug fix
      '============================================================
      rectangletop_height = Math.Max(5, windowheight-rectangleheight-gap)
      
      If rectangletop_height < 0 Then
        TextWindow.WriteLine("error")    
      EndIf
      '================================================================

    Here's the modified program: KVW375



    • Edited by Jibba j Wednesday, February 19, 2014 8:22 PM <0 not <=0
    Tuesday, February 18, 2014 9:18 PM
  • Good catch!  It's hard to make a rectangle with a negative height :) 
    Wednesday, February 19, 2014 7:26 PM
  • Rectangle size supports values >= 0, but Ellipse Drawings support for size -/0/+ values.

    GraphicsWindow.DrawLine(0,50,GraphicsWindow.Width,50)
    GraphicsWindow.DrawEllipse(50,50,-30,-30)     ' neg. values
    GraphicsWindow.FillEllipse(100,50,-30,-30)    ' neg values
    Ell = Shapes.AddEllipse(0,0)                  ' zero
    Shapes.Move(Ell,150,50)

    GraphicsWindow.DrawLine(0,100,GraphicsWindow.Width,100)
    GraphicsWindow.DrawRectangle(50,100,0,0)      ' zero values
    GraphicsWindow.FillRectangle(100,100,0,0)     ' zero values
    Rect = Shapes.AddRectangle(0,0)               ' zero
    Shapes.Move(Rect,150,100)

    Wednesday, February 19, 2014 8:07 PM
    Answerer
  • Hi Pappa Lapub. Thanks good to know. I'll adjust the error condition.

    Negative values for ellipse could be handy.


    • Edited by Jibba j Wednesday, February 19, 2014 8:24 PM
    Wednesday, February 19, 2014 8:21 PM
  • As promised here's my offering.  It uses LitDev extension for highscore web store - this can easily be commented out to run without extension.  There are several parameters that can be changed to alter how it runs - near the top of the code.  Enjoy - Import LCN897.

    Friday, February 21, 2014 8:24 PM
  • Whoo, great LitDev, funny N easy to play. I'm not so fond of games & playing, but this one i really like and my better half shouts & screams full of fun on the other machine. :-0

    Different pipes if someone likes.

    Friday, February 21, 2014 10:47 PM
    Answerer
  • Okay, Here is my game.

    Download (it uses pics): link

    Video: link

    Here is a picture:


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11







    Friday, February 21, 2014 11:06 PM
    Answerer
  • Wow Zock - excellent - much closer to the original than mine.  I like the way the bird 'ducks and dives'.
    Friday, February 21, 2014 11:20 PM
  • Thank you!

    I forgot to mention, this uses no extensions.


    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Friday, February 21, 2014 11:22 PM
    Answerer
  • Jibba Jabba, Are you going to post yours?

    It is written: "'As surely as I live,' says the Lord, 'every knee will bow before me; every tongue will acknowledge God.'" Romans 14:11

    Saturday, February 22, 2014 8:18 PM
    Answerer
  • Zock, yeah for sure.

    I should be sweet to post something 23/2/2014 pm US time (+/- a day), all things equal.

    It will still be under construction though, but playable.

    I'm using this as a build, design and structure exercise. So I'm taking care with the structure. I've learnt heaps doing this.

    I'm hoping to continue building this game for a further month or so into a Flappy Deluxe.

    e.g. levels, user able to reconfigure, bird changes each level, ditch the poles and add other obstacles and of course sound effects. Big job for me.

    The menu copied across well and has passed testing.

    Saturday, February 22, 2014 9:04 PM