ABGTE2 confusion
------=_NextPart_000_0007_01C01329.4CFE6060
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I looked at a demo in ABGTE2 (D2004a) and found it very interesting but =
also confusing. There seems to be variables in there that haven't been =
declared, but are used anyways:
include image.e
include graphics.e
sequence ball, bounce
bounce =3D
25, --Does this determine where the ball=20
, -- bounces?
,
if graphics_mode(18) then
puts(1, "Mode Set Failure")
else
clear_screen()
ellipse(5, 1, {200,200}, {300,300})
for iy =3D 234 to 266 do --What is iy and ix? They =
haven't been declared.*
for ix =3D 200 to 300 do
if get_pixel({ix, iy}) =3D 5 then --*
pixel(15,{ix, iy}) --*
end if
end for
end for
for iy =3D 267 to 300 do
for ix =3D 200 to 300 do
if get_pixel({ix, iy}) =3D 5 then
pixel(9,{ix, iy})
end if
end for
end for
ball =3D save_image({193,193},{308,308}) -- Where was it =
that the picture of ball was created?
clear_screen()
position(1,1)
puts(1, "Press q to end this bouncing ball demo!")
while 1 =3D 1 do
if get_key() =3D 'q' then
exit
end if
for ix =3D 1 to length(bounce) do
display_image({270,bounce[ix]},ball)
end for
for ix =3D length(bounce) to 1 by -1 do
display_image({270,bounce[ix]},ball)
end for
end while
if graphics_mode(-1) then
puts(1, "Mode Set Failure")
end if
end if
Thanks for your help.=20
-Thomas
------=_NextPart_000_0007_01C01329.4CFE6060
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial>I looked at a demo in ABGTE2 (D2004a) and found =
it very=20
interesting but also confusing. There seems to be variables in there =
that=20
haven't been declared, but are used anyways:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>include image.e<BR>include =
graphics.e<BR>sequence=20
ball, bounce<BR>bounce=20
3.75,226.25, --Does=20
this determine where the ball=20
.125, =20
--=20
R>if=20
graphics_mode(18) then<BR> puts(1, "Mode Set=20
Failure")<BR>else<BR> =20
clear_screen()<BR> ellipse(5, 1, {200,200},=20
{300,300})<BR> for iy =3D 234 to 266 =
do =20
--What is iy and ix? They =
haven't=20
been =
declared.*<BR> for =
ix=20
=3D 200 to 300=20
nbsp; =20
if get_pixel({ix, iy}) =3D 5 then =20
pixel(15,{ix, iy}) =
=20
=20
=20
end if<BR> end=20
for<BR> end for<BR> for =
iy =3D 267=20
to 300 do<BR> for =
ix =3D 200=20
to 300=20
nbsp; =20
if get_pixel({ix, iy}) =3D 5=20
pixel(9,{ix,=20
; =20
end if<BR> end=20
for<BR> end for<BR> ball =
=3D=20
save_image({193,193},{308,308}) =20
-- Where was it that the picture of ball was=20
created?<BR> =
clear_screen()<BR> =20
position(1,1)<BR> puts(1, "Press q to end this =
bouncing=20
ball demo!")<BR> while 1 =3D 1=20
do<BR> if =
get_key() =3D 'q'=20
; =20
exit<BR> end=20
if<BR> for ix =3D =
1 to=20
length(bounce)=20
nbsp; =20
sp; =20
end for<BR> for ix =
=3D=20
length(bounce) to 1 by -1=20
nbsp; =20
sp; =20
end for<BR> end =
while<BR> if=20
graphics_mode(-1) =
puts(1, "Mode Set Failure")<BR> end if<BR>end=20
if<BR></FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for your help. =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
------=_NextPart_000_0007_01C01329.4CFE6060--
|
Not Categorized, Please Help
|
|