Anybody familiar with blitzplus?
Posted: Mon Mar 17, 2014 4:14 pm
I have a problem, sort of.
To a some degree I understand how types work, but the problem comes when I try to do this:
This code is basically saying if any object from "Type"(or "Class") has such and such parameters, or such and such X position Then set such and such parameters for every object of that "Type". E.G. if "this" block hits the ground then every other block should "stop" too.
The problem is that it is only applied to the last created object, every Check, or If statement gets applied to the last pointer, so I can't check for every object just the last one, which works properly. So basically all blocks of that "Type" will stop only if last created block (within the Type) stops, so If statements are not including other blocks in their conditions (I think so, I'm not sure)
Now, I know that there is thing called inheritance, composition and stuff, but it is all relatively new to me...
It is still so vague...
To a some degree I understand how types work, but the problem comes when I try to do this:
Code: Select all
New Type
Field Xpos
Field Ypos
Field .....
.
.
.
End Type
For some_number = 0 to 3
type_pointer.Type = New Type
type_pointer\Xpos = blahblah
type_pointer\Ypos = blahblah
Next
For type_pointer.Type = Each Type
pHandle = Handle(type_pointer)
;Handle takes an address of the pointer (previous/next) and stores it in a specific number from 1 to infinity ;when it is destroyed it cannot be reused again, handle of that pointer = 0
If type_pointer\Xpos = blehbleh
For type_pointer.Type = Each Type
type_pointer\Xpos = blohbloh
Next
End if
type_pointer = Object.Type(pHandle)
If type_pointer\Ypos = blehbleh
For type_pointer.Type = Each Type
type_pointer\Ypos = blohbloh
Next
End if
type_pointer = Object.Type(pHandle)
;Object.Type(pointer_handle) is taking a handle from a pointer and returns an object or pointer if you wish, of that "Type"
;I'm returning an object to a type_pointer of a first For/Each loop
;I did this because pointer gets to the last object/pointer in Type once it loops through nested For/Each loop
Next
The problem is that it is only applied to the last created object, every Check, or If statement gets applied to the last pointer, so I can't check for every object just the last one, which works properly. So basically all blocks of that "Type" will stop only if last created block (within the Type) stops, so If statements are not including other blocks in their conditions (I think so, I'm not sure)
Now, I know that there is thing called inheritance, composition and stuff, but it is all relatively new to me...
It is still so vague...