Object ID's
-
- Posts: 37
- Joined: Jan 26, 2017 7:54
Object ID's
Is there any way to assign ID's to object. For example, if I have 5 boxes on the screen box 1 would have b1, box 2 would be b2, etc. etc. I am writing a scrolling game that has MORE than 5 boxes (or tiles in my program) and they don't all fit on the screen at the same time. So I thought I would implement scrolling in my game. The best way I can figure is for the program to call objects by their ID's.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: Object ID's
I would suggest to create an array of boxes and use the array index as ID.
Code: Select all
Type tBox
...
End Type
Dim box(0 To 5) As tBox
Re: Object ID's
For a alternative way (visibility ON/OFF) see the Type (struct) in this post's code section.
You can in this way, speed up the refresh procedure, by NOT drawing, what is
outside of the current view-port (part screen currently shown to user).
You can in this way, speed up the refresh procedure, by NOT drawing, what is
outside of the current view-port (part screen currently shown to user).
Code: Select all
' assume, procedure implementation starts here:
If Not [Rectangle].vis Then Exit Sub/Function ' whatever it may be: inside [...] and proc. type
' from here, start drawing implementation ...
Re: Object ID's
Of course there is a way. Can you show some code, to have a better idea of what you're trying to accomplish? Also, which type of game we're talking about? Side-scroller, Top-down, other?TurtleProgrammer wrote:Is there any way to assign ID's to object...