Mail Archives: djgpp/2000/01/24/07:52:05
Damian Yerrick schrieb:
>
> On Fri, 21 Jan 2000 19:07:47 -0500, Sahab Yazdani
> <beyonder69 AT geocities DOT com> wrote:
>
> >Hello I have written a simple trajectory calcutation system using
> >Velocity, Angle, wind and gravity. Now lets say I want to make the
> >projectile bounce off the wall.. How would I go about doing this???
>
> Here's an Allegro program in which the mouse controls the wind, and
> the pointer bounces off the screen edges and is attracted to the
> bottom.
>
> /**************************************\
> * DJTESTS.C *
> * Test DJGPP properties *
> * By Damian Yerrick *
> \**************************************/
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <conio.h>
> #include <dos.h>
> #include <mem.h>
>
> #include <allegro.h>
>
> /* DY_action_proc() ********************
> * By Damian Yerrick
> * Inherits from d_button_proc()
> * Declare this control as D_EXIT in your dialog item list.
> *
> * When clicked, this button calls the function in dp2:
> * int foobar(DIALOG *d);
> * Then it un-highlights the button and returns what the callback
> returned.
> */
----------snip
install_mouse();
> puts("Loading");
> fnt1 = load_datafile("FNT1.DAT");
> if(!fnt1)
> {
> allegro_exit();
> return 253;
> }
> if(set_gfx_mode(GFX_VGA, 320, 200, 0, 0))
> {
> unload_datafile(fnt1);
> allegro_exit();
> return 252;
> }
>
> set_palette(desktop_palette);
>
> // dlg[4].dp2 = fnt1[SMALL_FNT].dat;
>
> ret = do_dialog(dlg, -1);
>
> show_mouse(NULL);
> fade_out(2);
>
> allegro_exit();
> return ret;
> }
>
> int main(void)
> {
> return TestGUI();
> }
>
> --
> Damian Yerrick http://yerricde.tripod.com/
> View full sig at http://www.rose-hulman.edu/~yerricde/sig.html
> Comment on story ideas at http://home1.gte.net/frodo/quickjot.html
where to get the file "fnt1.dat" please ?
- Raw text -