Adro
Member
Hi there,
I'm making an asteroids clone to teach myself GM. I'm still pretty new to this whole thing, so I bet there's something simple I'm missing!
I have a radar in the top right cover, and it works, but the asteroids are showing up with the wrong colours and sizes. Weirdly the radar shows the right colour for the player (green) but only the last colour referred to when looking for asteroids in the play area and placing them on the radar/mini-map.
I've included the code below. Any suggestions would be a great help! Thanks in advance!
I'm making an asteroids clone to teach myself GM. I'm still pretty new to this whole thing, so I bet there's something simple I'm missing!
I have a radar in the top right cover, and it works, but the asteroids are showing up with the wrong colours and sizes. Weirdly the radar shows the right colour for the player (green) but only the last colour referred to when looking for asteroids in the play area and placing them on the radar/mini-map.
I've included the code below. Any suggestions would be a great help! Thanks in advance!
Code:
var asteroidCount_ss;
asteroidCount_ss = instance_number(obj_asteroid_ss);
draw_set_color(c_red);
for (k=0; k<asteroidCount_ss; k+=1) {
asteroidId_ss = instance_find(obj_asteroid_ss, k);
var wherex = xp + asteroidId_ss.x*(xscale);
var wherey = yp + asteroidId_ss.y*(yscale);
draw_circle(wherex, wherey,2,false);
}
var asteroidCount_s;
asteroidCount_s = instance_number(obj_asteroid_s);
draw_set_color(c_blue);
for (w=0; w<asteroidCount_s; w+=1) {
asteroidId_s = instance_find(obj_asteroid_s, w);
var wherex = xp + asteroidId_s.x*(xscale);
var wherey = yp + asteroidId_s.y*(yscale);
draw_circle(wherex, wherey,3,false);
}
var asteroidCount;
asteroidCount = instance_number(obj_asteroid);
draw_set_color(c_yellow);
for (r=0; r<asteroidCount; r+=1) {
asteroidId = instance_find(obj_asteroid, r);
var wherex = xp + asteroidId.x*(xscale);
var wherey = yp + asteroidId.y*(yscale);
draw_circle(wherex, wherey,4,false);
}
// draw player
if (instance_exists(obj_player)) {
var wherex = xp + obj_player.x*(xscale);
var wherey = yp + obj_player.y*(yscale);
draw_set_color(c_green);
draw_circle(wherex, wherey,2, false)
}