Computer Science Canada stuck on game |
Author: | tidusraven [ Fri Jan 15, 2010 10:08 am ] | ||
Post subject: | stuck on game | ||
im stuck on trying to make the ball on top move, and im having some trouble finishing off my code because im not sure exactly how to make it
|
Author: | Turing_Gamer [ Fri Jan 15, 2010 10:13 am ] |
Post subject: | Re: stuck on game |
First have your cls at the begining of your main code and your View.Update out of the if loop and at the bottom. Then have your Draw.Pic's right after the cls. And in your keying spots have them changing the varaible only, remove the cls in them |
Author: | tidusraven [ Fri Jan 15, 2010 10:22 am ] |
Post subject: | Re: stuck on game |
Turing_Gamer @ Sat Jan 16, 2010 2:13 am wrote: First have your cls at the begining of your main code and your View.Update out of the if loop and at the bottom.
Then have your Draw.Pic's right after the cls. And in your keying spots have them changing the varaible only, remove the cls in them alright well what you said and im still having an issue ![]() i did this like you said loop cls y2 := y2 - 1 drawfillbox (0, 0, 900, 605, black) Input.KeyDown (chars) if chars (KEY_RIGHT_ARROW) then xcounter := xcounter + 1 Draw.FillBox (xcounter, y, xcounter + xx, yy, yellow) elsif chars (KEY_LEFT_ARROW) then xcounter := xcounter - 1 Draw.FillBox (xcounter, y, xcounter + xx, yy, yellow) end if drawfilloval (x2,y2,10,10,black) delay (10) drawfilloval (x2, y2, 10, 10, yellow) if x2 > x and x2 < xx and y2 = y then end if end loop View.Update |
Author: | TheGuardian001 [ Fri Jan 15, 2010 10:38 am ] |
Post subject: | Re: stuck on game |
Will your program ever reach the View.Update line, which you put outside of the loop? |
Author: | ProgrammingFun [ Sat Jan 16, 2010 9:32 am ] |
Post subject: | RE:stuck on game |
You either need to put View.Update inside the loop or exit the loop with something like: exit when variable = 10 so that your program can get to the View.Update screen. If however, you cannot exit your loop, you can put this loop and the View.Update in another loop so that when you exit, it will automatically startup again but it will have done View.Update. |
Author: | Turing_Gamer [ Sun Jan 17, 2010 3:55 pm ] | ||
Post subject: | Re: stuck on game | ||
lol i meant this
|
Author: | tidusraven [ Mon Jan 18, 2010 9:53 am ] |
Post subject: | Re: stuck on game |
alright thanks , also i was wondering how to make the ball disapear when it hits the a certain Y , i understand that every difficulty has a value for y, but how would i make it disapear for lets say easy y := maxy div 2 - 140 yy := maxy div 2 - 190 var xx:int xcounter := maxx div 2 - 25 if choice = "easy" then xx := 70 y := 30 yy := 0 |
Author: | Turing_Gamer [ Mon Jan 18, 2010 12:01 pm ] |
Post subject: | Re: stuck on game |
I would have if you hit a target with a certain bullet then move specific bullet offscreen, reset target, score incriment, etc. |
Author: | tidusraven [ Mon Jan 18, 2010 7:39 pm ] |
Post subject: | RE:stuck on game |
yea someone also suggested the thing, but any clue on how i could do it? if you don't want to give me the script, any chance you can link me to a tut and then i can try to figure it out myself. |
Author: | Turing_Gamer [ Mon Jan 18, 2010 9:35 pm ] |
Post subject: | Re: stuck on game |
I believe you can figure this one on your own. - Moving bullet offscreen is easy, just set the xbullet value to a negative number. Call it back when you fire - Reseting target is also not a problem. I suggest a random x position and an offscreen y position - Score incriment is very simple (score := score + 1) I'm not being rude, I'm just giving you a general direction. And isn't discovery better when you do it yourself??? Good Luck... |
: |