the annoying game

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
Nituvious
Addict
Addict
Posts: 1027
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

the annoying game

Post 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
Last edited by Nituvious on Mon Apr 12, 2010 10:07 pm, edited 2 times in total.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: the annoying game

Post 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.
oh... and have a nice day.
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: the annoying game

Post by UserOfPure »

Why do you think it's in the showcase?
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: the annoying game

Post by Foz »

Look where it's posted:

Board index » Showcase » Applications - Feedback and Discussion
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: the annoying game

Post 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
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: the annoying game

Post 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.
oh... and have a nice day.
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: the annoying game

Post by UserOfPure »

Kaeru Gaman wrote:I wonder what your question is.
See my post just above. ;) It's a case of mistaken URL.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Re: the annoying game

Post by Kaeru Gaman »

and I misunderstood your question. :lol:
oh... and have a nice day.
Nituvious
Addict
Addict
Posts: 1027
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: the annoying game

Post by Nituvious »

To please the masses... :roll:
Image
▓▓▓▓▓▒▒▒▒▒░░░░░
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: the annoying game

Post 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.
Foz
Addict
Addict
Posts: 1359
Joined: Tue Nov 13, 2007 12:42 pm
Location: Manchester, UK

Re: the annoying game

Post 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.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: the annoying game

Post 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)
BERESHEIT
Nituvious
Addict
Addict
Posts: 1027
Joined: Sat Jul 11, 2009 4:57 am
Location: United States

Re: the annoying game

Post 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.
▓▓▓▓▓▒▒▒▒▒░░░░░
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Re: the annoying game

Post by netmaestro »

Don't let PB push you around, Nituvious. You have every right to post here, same as any member.
BERESHEIT
User avatar
Demivec
Addict
Addict
Posts: 4257
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: the annoying game

Post 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.
Post Reply