Pardon me for my ignorance on types, but I have a question which may turn out to be stupid.
I've got a quad entity created but I want to be able to create it inside a Type. Rather than creating it seperately in another variable.
I'm not sure of the syntax or even if what I'm doing is possible.
Basically I want to create a type with custom fields in it
; For example:-
Type alien
Field x,y
Field quad
Field texture
End Type
and then be able to access stuff like
PositionEntity newalien\quad,x,y
EntityTexture newalien\quad,newalien\texture
but I can't seem to figure out how to define texture and quad in the alien type declaration.
Something C++ object style like this:-
Type alien
Field Int x,Int y
Field Quad quad
Field Image texture
End Type
I've created a quad already and normally I access that by going:-
new_sprite_object = CopyEntity(quad)
But I want to automate this and stick it inside the type somewhere. Maybe like:-
function newalien(x,y,image$)
newalien = New alien
newalien\quad = CopyEntity(quad)
newalien\image = Loadimage(image$)
return newalien
end function
If I could just figure out how to create an entity when I create a new type then I'd be sorted. I hope I'm making sense.
HELP! :)
I've got a quad entity created but I want to be able to create it inside a Type. Rather than creating it seperately in another variable.
I'm not sure of the syntax or even if what I'm doing is possible.
Basically I want to create a type with custom fields in it
; For example:-
Type alien
Field x,y
Field quad
Field texture
End Type
and then be able to access stuff like
PositionEntity newalien\quad,x,y
EntityTexture newalien\quad,newalien\texture
but I can't seem to figure out how to define texture and quad in the alien type declaration.
Something C++ object style like this:-
Type alien
Field Int x,Int y
Field Quad quad
Field Image texture
End Type
I've created a quad already and normally I access that by going:-
new_sprite_object = CopyEntity(quad)
But I want to automate this and stick it inside the type somewhere. Maybe like:-
function newalien(x,y,image$)
newalien = New alien
newalien\quad = CopyEntity(quad)
newalien\image = Loadimage(image$)
return newalien
end function
If I could just figure out how to create an entity when I create a new type then I'd be sorted. I hope I'm making sense.
HELP! :)