oddchild
New member
- Joined
- Jul 18, 2017
- Messages
- 24
Hi Everyone,
I haven't been programming in a few years. I used to use Blitzmax, but was wanting to do something with Cerberus...
In Blitz there was a kind of a list called Tlist I could load my objects up into it, then call the list later and draw the images that way. I could also sort that list.
This would add the guys to the list when ever the dudes type was made. I understand that Type in Monkey / CErberus is Class. But even with changing that I cannot figure out.
In Blitz I could just run this, and make 40 sprites easy.
but if I try that same kind of code it isnt working.
What kind of list do I need to use for objects???
Thanks!!!
I haven't been programming in a few years. I used to use Blitzmax, but was wanting to do something with Cerberus...
In Blitz there was a kind of a list called Tlist I could load my objects up into it, then call the list later and draw the images that way. I could also sort that list.
Code:
Global EntityList:TList = New TList
Global sorter:TList = New TList
Type dudes
Field x:Float
Field y:Float
Field kind ' is he a cop or a normal guy
Field img 'load up the dudes
Field direction 'which way is he going
Field speed 'how fast
Field frame 'frame of animation
Field hp
Method New()
EntityList.AddLast(Self)
totaldudes = totaldudes + 1
End Method
End Type
This would add the guys to the list when ever the dudes type was made. I understand that Type in Monkey / CErberus is Class. But even with changing that I cannot figure out.
In Blitz I could just run this, and make 40 sprites easy.
Code:
For Local number = 0 To 40
guys:dudes = New dudes
guys.kind = Rand (1,6)
....
but if I try that same kind of code it isnt working.
Code:
For guys:dudes = EachIn Entitylist
DrawImage guys.img, guys.x + mapx ,guys.y + mapy,guys.frame
Next
What kind of list do I need to use for objects???
Thanks!!!
Last edited by a moderator: