Posts: 14
Threads: 3
Joined: Sep 2005
Thank you very much, works good, except, i need it to not accelerate when going in, and not deaccelerate when moving out, plus i need do loops, instead of for next
Simplier =)
but again, thank you.
and no, i do not need it filled in
p.s. could you explain to me what some of that means? thanks.
There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
Posts: 140
Threads: 13
Joined: Apr 2005
Code: SCREEN 12
s% = 1
WHILE INKEY$ = ""
IF s% = 1 THEN a% = 0: e% = 220: c% = 1 ELSE a% = 220: e% = 0: c% = 0
FOR r% = a% TO e% STEP s%
CIRCLE (320, 240), r%, c%: FOR p = 0 TO 1000: NEXT
NEXT
s% = s% * -1
WEND
sorry about my english
Posts: 650
Threads: 26
Joined: Aug 2004
i think he may need this:
[syntax="qbasic"]SCREEN 13
x = 160: y = 100
DO
orr = r
IF a = 0 THEN r = r + 1: IF r = 101 THEN a = 1
IF a = 1 THEN r = r - 1: IF r = 0 THEN a = 0
CIRCLE (x, y), orr, 0
CIRCLE (x, y), r, 1
s = TIMER: DO: LOOP UNTIL TIMER > s + .001
LOOP[/syntax]
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Posts: 2,765
Threads: 138
Joined: Nov 2002
FB FTW
Code: option explicit
SCREEN 13,32,1,1
dim as integer x,y,r,rv
dim as double s
dim as string press
x = 160: y = 100: r = 0: rv=1
DO
locate 1,1: print r,rv
CIRCLE (x,y),r,0
r=r+rv
if r>50 then rv=-1 else if r<1 then rv=1
CIRCLE (x, y), r, 1
s = TIMER: DO: LOOP UNTIL TIMER > s + .01
press=inkey$
LOOP until press=chr$(255)+"X"
=D
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 2,404
Threads: 153
Joined: Jan 2005
@ WT: No, you'll kill FreeBASIC like that... Make ppl think its not like QBasic, when it is but just has a few new things... Fueling more debates later on.. *grr*
Code for FB and QB: Or at least, its WT above edited..
Code: SCREEN 13
dim as integer x,y,r,rv
dim as double s
dim as string press
x = 160: y = 100: r = 0: rv=1
DO
locate 1,1: print r,rv
CIRCLE (x,y),r,0
r=r+rv
if r>50 then rv=-1 else if r<1 then rv=1
CIRCLE (x, y), r, 1
s = TIMER: DO: LOOP UNTIL TIMER > s + .01
press=inkey$
LOOP until press=chr$(27)
If it doesn't work in QB I missed something....
Kevin ( x.t.r.GRAPHICS)
Posts: 14
Threads: 3
Joined: Sep 2005
alright this is what i was talking about...(I got it now) I was thinking something like this:
Code: Screen 12
Cls
Do
Do while x= 200
x=x+1
Circle (200, 200), 1+x, 1
For Delay = 1 to 1000
next delay
Circle (200, 200), 0+x, 0
Loop
Do while x=0
x=x-1
Circle (200, 200), 1+x, 1
For delay = 1 to 1000
Next delay
Circle (200, 200), 0 +x, 0
Loop
Loop
(This might be wrong btw, i just through some stuff together to show you how it should look like)
I really didn't need all that fancy stuff. But thanks anyways :wink:
also new project: Same type of code, except I need 1 circle in each corner (4 circles in total) that don't go off the screen (screen 12) when they get larger and smaller. They need to do the same thing as the last circle did except one of each in each corner, and they all need to go in and out at the same time. Needs to be in this format, without a timer, no if/thens, and almost exactly like this code but it has 4 circles.
Thanks in Advance,
Shizzell
There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
Posts: 2,765
Threads: 138
Joined: Nov 2002
Quote:also new project: Same type of code, except I need 1 circle in each corner (4 circles in total) that don't go off the screen (screen 12) when they get larger and smaller. They need to do the same thing as the last circle did except one of each in each corner, and they all need to go in and out at the same time. Needs to be in this format, without a timer, no if/thens, and almost exactly like this code but it has 4 circles.
Thanks in Advance,
Shizzell
o_O
No one.. I mean... Absolutely no programmer that knows how to write good code would do it that way (Or so I think).
I'd use a Timer. If/thens and... aaaand... well here:
Code: OPTION EXPLICIT
SCREEN 12,32,1
#DEFINE MAXRADIUS 100
#DEFINE SCREENW 640
#DEFINE SCREENH 480
DIM AS INTEGER x,y,r,rv
DIM AS DOUBLE s
DIM AS STRING press
r = 0: rv=1
DO
LOCATE 1,1: PRINT r,rv
CIRCLE (MAXRADIUS,MAXRADIUS),r,0
CIRCLE (SCREENW-MAXRADIUS,MAXRADIUS),r,0
CIRCLE (MAXRADIUS,SCREENH-MAXRADIUS),r,0
CIRCLE (SCREENW-MAXRADIUS,SCREENH-MAXRADIUS),r,0
r=r+rv
IF r>MAXRADIUS THEN rv=-1 ELSE IF r<1 THEN rv=1
CIRCLE (MAXRADIUS,MAXRADIUS),r,1
CIRCLE (SCREENW-MAXRADIUS,MAXRADIUS),r,1
CIRCLE (MAXRADIUS,SCREENH-MAXRADIUS),r,1
CIRCLE (SCREENW-MAXRADIUS,SCREENH-MAXRADIUS),r,1
s = TIMER: DO: LOOP UNTIL TIMER > s + .01
press=INKEY$
LOOP UNTIL press=chr$(255)+"X"
(FB FTW)
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 14
Threads: 3
Joined: Sep 2005
Quote:o_O
No one.. I mean... Absolutely no programmer that knows how to write good code would do it that way (Or so I think).
...wow. dude its only like 4 pages of code at tops. i dunno. 5 minutes if you know good coding....
There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
Posts: 2,765
Threads: 138
Joined: Nov 2002
How big is a page to you? o_O I don't know what that means....
Why sacrifice... well there's nothing to sacrifice. It's easier to make efficent, well structured code. It's also usually shorter =P
Back by popular demand!
I will byte and nibble you bit by bit until nothing remains but crumbs.
Posts: 14
Threads: 3
Joined: Sep 2005
Dude i figured it out, thanks for ur help though, and everyone elses :wink:
There's this doctor, and this boy. They both go fishing. The Boy is the Doctor's son, however the doctor is not his father. Who is the Doctor?"
|