12-22-2004, 09:09 AM
Hello!
I'm both new to the forums and also programming in general. Most of my programming experience has been from playing on my calculator and taking a programming class at school. Since both use a basic, I decided to start playing around with qbasic, and quickly found out about freeBASIC.
Freebasic was just what i was looking for to spark my interest in programming... thanks so much you guys!!!
Anyways..... i have a couple of questions so please bear with me, b/c i am a "n00bz0r".
1. I know freeBasic doesnt support the graphic functions (draw, pset, line, etc...) and i've been reading up on this forum about different graphic libraries being used. Could you explain the differences between the libraries (api, sdl, openGL) and recommend how I should go about learning them, like maybe some good sites or resources? I've been searching on google, but mostly have found incomplete or outdated info.
2. I've made a program of a ball bouncing in a box. However, it seems to flash alot. I then replaced the cls with writing a black square over the ball. This seemed to help, but the box still flashes a little. Could you guys give me some advice on the code?:
Again, awesome site and compiler and sorry about the stupid questions.
I'm both new to the forums and also programming in general. Most of my programming experience has been from playing on my calculator and taking a programming class at school. Since both use a basic, I decided to start playing around with qbasic, and quickly found out about freeBASIC.
Freebasic was just what i was looking for to spark my interest in programming... thanks so much you guys!!!
Anyways..... i have a couple of questions so please bear with me, b/c i am a "n00bz0r".
1. I know freeBasic doesnt support the graphic functions (draw, pset, line, etc...) and i've been reading up on this forum about different graphic libraries being used. Could you explain the differences between the libraries (api, sdl, openGL) and recommend how I should go about learning them, like maybe some good sites or resources? I've been searching on google, but mostly have found incomplete or outdated info.
2. I've made a program of a ball bouncing in a box. However, it seems to flash alot. I then replaced the cls with writing a black square over the ball. This seemed to help, but the box still flashes a little. Could you guys give me some advice on the code?:
Code:
cls
print "***Program by: RJ***"
print "Watch the ball go!!!"
input "Hit anykey to continue.";p
cls
let x=10
let y=10
let xadj=1
let yadj=1
'game
do
'top outline
let r= 1
let c= 1
for c = 1 to 80
locate r,c
print Chr$(177)
next c
'bottom outline
let r= 22
let c=1
for c = 1 to 80
locate r,c
print Chr$(177)
next c
'left outline
let c=1
let r=1
for r=1 to 22
locate r,c
print Chr$(177)
next r
'right outline
let c=80
let r=1
for r = 1 to 22
locate r,c
print Chr$(177)
next r
'black to erase ball because cls sux
let Row=x
let Col=y
locate Row,Col
print Chr$(255)
'bouncy ball
IF y <= 2 THEN yadj = 1
IF y >= 79 THEN yadj = -1
IF x >= 22 THEN xadj = -1
IF x <= 2 THEN xadj = 1
x = x + xadj
y = y + yadj
locate x,y
print Chr$(2)
loop
Again, awesome site and compiler and sorry about the stupid questions.