forum.boolean.name

forum.boolean.name (http://forum.boolean.name/index.php)
-   2D-программирование (http://forum.boolean.name/forumdisplay.php?f=109)
-   -   Field Extends GameObject (http://forum.boolean.name/showthread.php?t=14531)

teremochek 04.04.2011 20:35

Field Extends GameObject
 
Type TGameObject
Field X:Float
Field Y:Float
Field Image:Timage

Method DrawSelf()
' DrawImage Image,X*5,Y*5
End Method
End Type



Type TStartMenuSerdce Extends TGameObject
Field Z:Float
Method DrawSelf()
DrawImage Image,X*5,Y*5
End Method
End Type


Для того, чтобы получить значение Field X, из Метода любого объекта:

For Local a:TGameObject = EachIn GameObjectList
a.X=1
Next

Подскажите как получить значение поля Z ?

SBJoker 04.04.2011 20:49

Ответ: Field Extends GameObject
 
Код:

if TStartMenuSerdce(a) then
      TStartMenuSerdce(a).Z = 100
end if



Часовой пояс GMT +4, время: 14:41.

vBulletin® Version 3.6.5.
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Перевод: zCarot