Re: item class in python?

Here's how I would do it in bgt.
obj@[]objs(0);//The array of items.
class obj
{
int x,y,loop;
obj(int ox, int oy)
{
x=ox;
y=oy;
loop=p.play_2d("loop.ogg",me.x,me.y,obj.x,obj.y,obj.z,false);//I don't remember the code to make it play on a slot, I can look later.
}
}
void objloop()
{
for(int i=0; i<objs.length; i++)
{
p.update_sound_2d(loop,objs[i].x,objs[i].y);
}
}
void spawnobjj(int x, int y)
{
//spawn code, don't remember it. Basically take the values given to the void and send it to the class, then add it to the objs array.
}


-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : cmerry via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : redfox via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector

Reply via email to