Re: Using handles in bgt somewhat confuse me

woah, sneak, that's cool!
It kind of creates a musical harmony that's off sync with itself but the way it sounds is quite cool.
Ok, so let's say, I have a class of robots.
class robot
{
int integrity;
int speed;
int pos;
//constructor will be placed here. I like using a constructor like this, because I can call enemies of varying strengths and speeds.
robot (int init_integrity, int init_speed, int init_pos)
{
integrity=init_integrity;
speed=init_speed;
pos=init_pos;
}
//methods can go here.
}
Ok, that's fine and everything.
So let's say I need to declare a robot of type, uh, I don't know, let's just call it robotAlpha, for now.
robot robotAlpha(50, 1000, 15);
I set robotAlpha's integrity to 50, it's speed to 1000 (slow robot), and its position to 15 almost completely on the left depending on how big the board is.
Now, let's spaw n another robot of type doomsday machine which won't be all badass as it sounds here.
robot dDayMachine(350, 450, playerpos+random(30, 45)); //makes the robot spawn depending on wherever the player will be, roughly. I could have of course given it a direct position, but felt it needed to spawn close to the player.
Now, we have two robots one standard, one which could possibly take over the world aaaaa.
to make them move, ideally you would want to give them there own speeds, but something I'm not so sure of, can I get away with using one single timer for multiple enemies of the same class?
My guess is no, because then everything on screen would suddenly go flying across the stage as the timer elapsed and restarted.
Or furthermore, not only would it not work properly, but I'm also guessing the timer would restart far before some enemies got the chance to move.
Which also leads me to a very important question.
To pull this off, I am the orizing I'm going to need a bunch of handles to check where each robot is on the stage.
Yeah, I guess I could assign two handles one to the regular robot, and one to the doomsday machine.
But say a random robot with random attributes spawns every 5000 ms (5 seconds), to make our lives more difficult.
I'm guessing then and there would be the time to use an array of handles?
But what makes my brain confused is, how do I tell the engine which robot has just hit the player, or what robot needs to have something at all special happen, like die or be hit by the players force?

_______________________________________________
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Victorious via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : severestormsteve1 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Lucas1853 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Kyleman123 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : sneak via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Omar Alvarado via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : CAE_Jones via Audiogames-reflector

Reply via email to