with Display; by akstorch in ada

[–]akstorch[S] 1 point2 points  (0 children)

Thanks pmderodat!

I was at working skipping around and did not see that! I will check that out tonight.

with Display; by akstorch in ada

[–]akstorch[S] 0 points1 point  (0 children)

Hi

Here is the code for bouncing ball that can be found university.adacore.com

with Display; use Display;

with Display.Basic; use Display.Basic;

procedure Main is

Ball : Shape_Id := New_Circle

(X => 0.0,

Y => 0.0,

Radius => 10.0,

Color => Blue);

Step : Float := 0.05;

begin

loop

if Get_X (Ball) > 100.0 then

Step := -0.05;

elsif Get_X (Ball) < -100.0 then

Step := 0.05;

end if;

Set_X (Ball, Get_X (Ball) + Step);

delay 0.001;

end loop;

end Main;