Please help, I realy need help!
I need a program which shows a simple ball on the screen, just a ball.
Its position must be defined by (x,y) coordinates.I mean I would be able
to play with (x,y) in order to change the position.
P.S.: it is NOT my homework, I just need this piece of code to go
further.
Please help, I realy need help!
I need a program which shows a simple ball on the screen, just a ball.
Its position must be defined by (x,y) coordinates.I mean I would be able
to play with (x,y) in order to change the position.
P.S.: it is NOT my homework, I just need this piece of code to go
further.
Take a look at the SFML - Simple and Fast Media Library. It can most
likely help you with that.
Or... Did you mean in Ruby? Do you want it text-based or graphics-based?
Should we choose for you the graphics library which will determine the
rest of your program?
Please help, I realy need help!
I need a program which shows a simple ball on the screen, just a ball.
Its position must be defined by (x,y) coordinates.I mean I would be able
to play with (x,y) in order to change the position.
P.S.: it is NOT my homework, I just need this piece of code to go
further.
On Fri, Dec 11, 2009 at 8:43 PM, Teodor Carstea <teodorcarstea@yahoo.com> wrote:
Please help, I realy need help!
I need a program which shows a simple ball on the screen, just a ball.
Its position must be defined by (x,y) coordinates.I mean I would be able
to play with (x,y) in order to change the position.
P.S.: it is NOT my homework, I just need this piece of code to go
further.
look: I study C/C++ in the college, but Ruby I study by myself, I want
to write a first course program in Ruby(it was a C code of a shell
trajectory, launched by user's speed and angle). I've already written
the program in Ruby, it calculates the shell position at every period of
time.The output looks like
ok, now I need to make it "alive". In C/C++ I can, but in Ruby, I have
no idea.
Therefore I need a piece of code which creates a window and point a
ball(it will be the shell). Any ideas?
look: I study C/C++ in the college, but Ruby I study by myself, I want
to write a first course program in Ruby(it was a C code of a shell
trajectory, launched by user's speed and angle). I've already written
the program in Ruby, it calculates the shell position at every period of
time.
Therefore I need a piece of code which creates a window and point a
ball(it will be the shell). Any ideas?
"ruby game library" will be a useful google search, you'll find
libraries like:
- gosu
- rubygame
- ruby/sdl
- star ruby http://gpwiki.org/index.php/Ruby
This small page is not exhaustive but can get you started.
Thanks to all! hope it will help. and it's better than getting the code
already done. Cheers!
--
Posted via http://www.ruby-forum.com/\.
Also you find many examples of graphic programming using Ruby and Shoes
here
ok, now I need to make it "alive". In C/C++ I can, but in Ruby, I have
no idea.
What library did you use in C/C++ to draw the graphics? You may find
that there's a Ruby binding to the same library, so you won't have to
learn a new API.
ok, now I need to make it "alive". In C/C++ I can, but in Ruby, I have
no idea.
What library did you use in C/C++ to draw the graphics? You may find
that there's a Ruby binding to the same library, so you won't have to
learn a new API.
well, take a look, it's a bit of code I needed to use to initialize
graphics mode(I've used Borland 3):
0 #include <stdio.h>
1 #include <conio.h>
2 #include <stdlib.h>
3 #include <graphics.h>
4 int main(){
5 //initializing graphics mode
6 int gdriver=DETECT, gmode, errorcode;
7 initgraph(&gdriver, &gmode, "C:\\Progra~1\\BORLANDC\\BGI");
8 errorcode = graphresult();
9 if(errorcode!=grOk) {
10 cout<<"Graphics error!!!\n"
11 <<"Press any key...";
12 getch();
13 exit(1);
14 }
15 /*
16 AND HERE IS BLA-BLA-BLA CODE OF MY PROGRAM(let's say: a square on
the 17 screen, which changes its color, every time you hit "Enter")
18 */
19 return 0;
20 }
actually, I kannot comment the code between lines 6 and 14. I just knew
I had to insert it into my main code and add #include<graphics.h> and my
program will work. I thought there is smth like that in Ruby, and I have
just to insert it into my code, look the posts above....
actually, I kannot comment the code between lines 6 and 14. I just knew
I had to insert it into my main code and add #include<graphics.h> and my
program will work.
Hmm, that's a new API to me. Googling around suggests it's part of Turbo
C++, possibly BGI: