Page 1 of 3

the annoying game

Posted: Sun Apr 11, 2010 5:43 am
by Nituvious
Hi, this is something I threw together in a few minutes. I wanted to see if I could divide by zero... (+Infinity!?)

Here is the binary with the image. Also the path was changed for the image.
Image

Code: Select all

Enumeration
  #MWindow
  #MLoadImage
  #MImage
EndEnumeration
Global xScore.l,ImgX = Random(350),ImgY = Random(350)
Global sSeconds.l = 30000


UsePNGImageDecoder()
LoadImage(#MLoadImage,"\Catchme.png")

OpenWindow(#MWindow,0,0,400,400,"Score: 0",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ImageGadget(#MImage,ImgX,ImgY,50,50,ImageID(#MLoadImage),#PB_EventType_LeftClick)

Procedure sTimer()
  sSeconds.l-10
  Debug sSeconds.l
  If sSeconds.l <= 0
    ImgX = Random(350)
    ImgY = Random(350)
    ResizeGadget(#MImage,ImgX,ImgY,50,50)
    If xScore >= 1
      sSeconds = 30000/xScore.l+1
    Else
      sSeconds.l=30000
    EndIf
  EndIf
  
EndProcedure
Procedure sRandomMove()
  sTimer()
  Select EventType() 
    Case #PB_EventType_LeftClick
      Delay(5)
      xScore.l+1
      ImgX = Random(350)
      ImgY = Random(350)
      SetWindowTitle(#MWindow,"Score: "+Str(xScore.l))
      ResizeGadget(#MImage,ImgX,ImgY,50,50)
      If xScore >= 1
        sSeconds = 30000/xScore.l+1
      Else
        sSeconds.l=30000
      EndIf

  EndSelect
EndProcedure
Repeat
  EventID = WaitWindowEvent(10)
  sRandomMove()
Until EventID = #PB_Event_CloseWindow

Re: the annoying game

Posted: Sun Apr 11, 2010 10:01 am
by Kaeru Gaman
[WARNING] Line: 11
[WARNING] The specified file does not exist.
[ERROR] Line: 14
[ERROR] The specified #Image is not initialized.
... and this in the showcase?

Shame on You!


... if you want to put sourcecode into the showcase, use Drawing on Sprites or Images to create your Grafix on-the-fly.
btw: when loading content, never use absolute paths.

Re: the annoying game

Posted: Sun Apr 11, 2010 2:15 pm
by UserOfPure
Why do you think it's in the showcase?

Re: the annoying game

Posted: Sun Apr 11, 2010 2:24 pm
by Foz
Look where it's posted:

Board index » Showcase » Applications - Feedback and Discussion

Re: the annoying game

Posted: Sun Apr 11, 2010 2:27 pm
by UserOfPure
Ah, I see. I didn't notice. The only PureBasic ShowCase I knew of was this one -> http://www.purearea.net/pb/showcase/index.php

Re: the annoying game

Posted: Sun Apr 11, 2010 2:28 pm
by Kaeru Gaman
UserOfPure wrote:Why do you think it's in the showcase?
yes, I wonder why.

it's not runready, it spits an error.
such unfinished works is nothing the showcase is made for.
that is plain clear, I wonder what your question is.

Re: the annoying game

Posted: Sun Apr 11, 2010 3:04 pm
by UserOfPure
Kaeru Gaman wrote:I wonder what your question is.
See my post just above. ;) It's a case of mistaken URL.

Re: the annoying game

Posted: Sun Apr 11, 2010 4:19 pm
by Kaeru Gaman
and I misunderstood your question. :lol:

Re: the annoying game

Posted: Sun Apr 11, 2010 6:55 pm
by Nituvious
To please the masses... :roll:
Image

Re: the annoying game

Posted: Sun Apr 11, 2010 9:29 pm
by UserOfPure
Nituvious wrote:To please the masses...
Not really. You still don't get it. This forum section is to provide apps that show off PureBasic in a big way; ie. the best of the best. Your app does not do this.

Re: the annoying game

Posted: Sun Apr 11, 2010 9:45 pm
by Foz
I vote for a "Something Neat" section.

It isn't a tip or a trick, and it isn't a full blown Showcase app/game. It's something that has been hacked together and does something neat.

Re: the annoying game

Posted: Sun Apr 11, 2010 9:55 pm
by netmaestro
You don't get it. This forum section is to provide apps that show off PureBasic in a big way; ie. the best of the best
It doesn't say that anywhere, work-in-progress should be fine here. Thanks for posting, Nituvious 8)

Re: the annoying game

Posted: Mon Apr 12, 2010 12:51 am
by Nituvious
UserOfPure wrote:Not really. You still don't get it. This forum section is to provide apps that show off PureBasic in a big way; ie. the best of the best. Your app does not do this.
Applications, Games, Tools, User libs and useful stuff coded in PureBasic
I do get "it". But I will refrain from posting anything else in this section.

Re: the annoying game

Posted: Mon Apr 12, 2010 12:58 am
by netmaestro
Don't let PB push you around, Nituvious. You have every right to post here, same as any member.

Re: the annoying game

Posted: Mon Apr 12, 2010 4:41 am
by Demivec
Once I corrected the path to the catchme.png it doesn't do anything for me. Is that the point of the annoying game? :(

It simply changes the window title to display a continuously increasing Score value. It doesn't seem to allow closing of the window either. I have to use the taskmanager to stop it (by starting taskmanager, then clicking close window on the 'game' window).


Running under Win XP x86.