# My First Game. "Eat the Tadpoles" ;)

• ### General discussion

• Hi, this is my first game. I made it with the help of "Zock77"

You are a fish and have to eat tadpoles.

Tell me what you think.

Cobra~

GraphicsWindow.MouseMove = MM

GraphicsWindow.BackgroundColor = "Blue"
GraphicsWindow.BrushColor = "green"
GraphicsWindow.Title = "Eaten = " + Eaten

For i = 1 To notadpoles
X[i] =  Math.GetRandomNumber(GraphicsWindow.Width)
Y[i] = Math.GetRandomNumber(GraphicsWindow.Height)
EndFor

Mouse.HideCursor()

While 1 = 1
Program.Delay(5)
For i = 1 To notadpoles
Y[i] = Y[i] + 3
Shapes.Move(M[i], X[i],Y[i])
if Y[i] = 0 > GraphicsWindow.Height  Then
X[i] = Math.GetRandomNumber(GraphicsWindow.Width)
EndIf
If X[i] >  GraphicsWindow.MouseX And X[i] < GraphicsWindow.MouseX + 100 And Y[i] > GraphicsWindow.Height - 100 Then
Eaten = Eaten + 1
GraphicsWindow.Title = "Eaten = " + Eaten
Y[i] = 0
X[i] = Math.GetRandomNumber(GraphicsWindow.Width)
EndIf
EndFor
EndWhile

Sub MM
Shapes.Move(Trout,GraphicsWindow.MouseX,GraphicsWindow.Height - 100)
EndSub

• Edited by Monday, June 11, 2012 6:05 PM
Monday, June 11, 2012 6:02 PM

### All replies

• Nice program,

I am curious what this line is supposed to check for? I'm surprised it compiles and I don't think it does anything.

`If Y[i] = 0 > GraphicsWindow.Height  Then`

The tadpoles' reappearance at the top only occurs in the if condition where "Y[i] = 0" is set, and then only when the trout moves over the X position of the tadpole, even if the tadpole is off the bottom of the screen.

Monday, June 11, 2012 6:32 PM
• Sweet. you have only one glitch. on this line:

If X[i] >  GraphicsWindow.MouseX And X[i] < GraphicsWindow.MouseX + 100 And Y[i] > GraphicsWindow.Height - 100 Then

it should be:                                                                                         \/

If X[i] >  GraphicsWindow.MouseX And X[i] < GraphicsWindow.MouseX + 10 And Y[i] > GraphicsWindow.Height - 100 Then

The width of the trout is only 10 not 100

Good Game!!!

PS. I only ansered a question. i didn't program this

Zock77

Monday, June 11, 2012 6:32 PM
• Try deleting it and the tadpoles will go around in circles really fast.
Monday, June 11, 2012 6:43 PM
• Yike! I didn't even catch that.

Zock77

Monday, June 11, 2012 6:47 PM
• I think he means that you should put:     If Y[i]  > GraphicsWindow.Height  Then

That will work a lot better

Zock77

Monday, June 11, 2012 7:16 PM
• it is supposed to say:       If Y[i] > GraphicsWindow.Height Then

Zock77

Monday, June 11, 2012 7:17 PM
• Yep, that makes sense - inside that IF also set Y[i] = 0 to reposition at the top.
• Edited by Monday, June 11, 2012 7:30 PM typo
Monday, June 11, 2012 7:28 PM
• oh I didn't read it s l o w l y. sorry my bad. Thanks for the help.
Monday, June 11, 2012 7:36 PM
• Im still learning, and you guys are doing a good job teaching me. thanks so much for the help!!!
Monday, June 11, 2012 7:53 PM
• You should post the updated version of your game!

Zock77

Monday, June 11, 2012 8:44 PM
• Ok here it is. Thanks guys!

pnt897-0

Monday, June 11, 2012 11:40 PM