none
test restart a game RRS feed

  • Question

  • Good evening community ^ ^

    I am trying to do a test to restart a game, when a game is over.
    I looked into several programs, I understand the principles by analyzing, but with my little knowledge, for now, I can not apply them to my code.
      

    But if you can watch and help me, or if you have a great tip, I'm interested.

    Thank you for your answers.

     

    Here's how my test code:

     

     

     

    '*********************************************************************************************************
    ' AFFICHAGE POUR LA FIN DU JEU
    '*********************************************************************************************************

    endgame:
      GraphicsWindow.Clear()
      Sound.PlayBellRing()
     
      GraphicsWindow.fontname = "HUXTABLE"
      GraphicsWindow.FontSize      = 60
      GraphicsWindow.DrawText      ( 600, 20, " ")
      GraphicsWindow.BrushColor    = "WHITE"
      GraphicsWindow.DrawText      ( 240, 200, "TON SCORE EST DE ")
      GraphicsWindow.fontname = "HUXTABLE"
      GraphicsWindow.FontSize      = 30
      GraphicsWindow.DrawText      ( 600, 20, " ")
      GraphicsWindow.BrushColor    = "RED"
      GraphicsWindow.DrawText      ( 300, 280, "Barre espace pour recommencer")
     


    key = GraphicsWindow.LastKey
    If (key = "Space") Then
    Sound.PlayBellRing()
    goto restart
    EndIf

    Goto endgame


    absolu
    Saturday, October 29, 2011 10:02 PM

Answers

  • What you want to do is put everything that is not in a subroutine into a subroutine called "begingame", and then when you need to restart the game, remove all of the images, and then just call the begingame() subroutine to reset everything else.
    ~~AirWaves!!~~
    Saturday, October 29, 2011 11:30 PM
  • Indeed.

    I finally had time to get back and I found.

    Thank you very much !

    absolu
    • Marked as answer by absolu Saturday, November 12, 2011 9:39 PM
    Tuesday, November 1, 2011 8:30 PM

All replies

  • What you want to do is put everything that is not in a subroutine into a subroutine called "begingame", and then when you need to restart the game, remove all of the images, and then just call the begingame() subroutine to reset everything else.
    ~~AirWaves!!~~
    Saturday, October 29, 2011 11:30 PM
  • Indeed.

    I finally had time to get back and I found.

    Thank you very much !

    absolu
    • Marked as answer by absolu Saturday, November 12, 2011 9:39 PM
    Tuesday, November 1, 2011 8:30 PM
  • Hello,

    I return to this post, because I still have a problem with the restart of a game.

     
    Here is the code import: SMN653

     
    There are some lines where the pictures are on ftp to better visualize the game, you just validate them by removing the apostrophe.

    At the end, I would like to ensure that pressing the space bar, the game starts (yes or not, for example). But I can not find the point of recovery.

    In addition, I found that the first phase of play (with introduction and mouse button) is not completely erased. That is, even when there is gambling, there are still areas of active and invisible buttons ...

    If you can help me understand, at least restart the game

    In advance, thank you

     

     


    absolu
    Thursday, November 17, 2011 9:10 AM
  • Good evening,

    I finally had time to change the lines of code for links ftp images and sprites, etc ...
    Here's the reference:

    MWH796

    It will be easier to see the problem.

    Thank you.


    absolu
    Thursday, November 17, 2011 8:45 PM
  • MWH796-0   

    This code can restart.

    Your comments are deleted and added my comments and simplified.

     

    Friday, November 18, 2011 3:01 PM
    Answerer
  • Thank you for the optimization of the program ^ ^
    It seems to me that there is still a problem for the call of background images:
    Intro
    game
    and end
    and being able to start with the keyboard or mouse events.

    Currently, I reworked the graphics. The painting part is coming soon.

    Could you help me in this phase of the program?

    Thank you.

    absolu
    Friday, November 18, 2011 11:04 PM
  • MWH796-2  

    How about this ? 

     

    Saturday, November 19, 2011 6:21 AM
    Answerer
  • Ok, great!


    I'll watch the program tomorrow in the morning (French time ^ ^).

    Thank you.


    absolu
    Saturday, November 19, 2011 8:58 PM
  • I just watched the program and it's perfect!

     
    Thank you.

     
    I finished the game graphics / panting, etc ... and I put the reference import of the program.

     



    absolu
    Monday, November 21, 2011 8:05 PM