M
mario_head
Guest
So I've made it through setting up the collisions and such.
Player has attacks, everything moves and explodes and splits as necessary, as well as movement wrapping being successfully implemented.
However, I've got one issue I've noticed, a particularly funny one imo, with one of the size variants of Asteroid.
For the "Huge" variant, I was feeling lazy, and decided, instead of drawing up another Asteroid, I'd just, as a joke, make a Sans head as an Asteroid (Which admittedly took much longer than the former).
So, what's confusing here, is that when I run the game, any and all instances of the Huge Asteroid will seem to gravitate towards the nearest object. I did see a similar post concerning the Asteroids changing direction while rotating, but looking closer I can definitely conclude that the Huge Asteroid is targeting nearby objects, as it slows and changes direction after wrapping.
I am running IDE Version 2.2.5.481
I would have included the coding for the Debris Object, but I know that is not relevant, as it had been coded in after discovery.
I've also looked over the coding quite a few times, and everything seems to match what the tutorial shows (Although I have been known to miss silly little differences multiple times)
Player has attacks, everything moves and explodes and splits as necessary, as well as movement wrapping being successfully implemented.
However, I've got one issue I've noticed, a particularly funny one imo, with one of the size variants of Asteroid.
For the "Huge" variant, I was feeling lazy, and decided, instead of drawing up another Asteroid, I'd just, as a joke, make a Sans head as an Asteroid (Which admittedly took much longer than the former).
So, what's confusing here, is that when I run the game, any and all instances of the Huge Asteroid will seem to gravitate towards the nearest object. I did see a similar post concerning the Asteroids changing direction while rotating, but looking closer I can definitely conclude that the Huge Asteroid is targeting nearby objects, as it slows and changes direction after wrapping.
I am running IDE Version 2.2.5.481
Code:
obj_argo ///(Ship/Player Object)
Step ///Movement & Attack Creation
if(keyboard_check(vk_left)){
image_angle = image_angle + 5; ///Turns the Object Left
}
if(keyboard_check(vk_right)){
image_angle = image_angle - 5; ///Turns the Object Right
}
if(keyboard_check(vk_up)){
motion_add(image_angle, 0.05); ///Adds Set Value of Motion
}
if(keyboard_check_pressed(ord("Z"))){
var inst = instance_create_layer(x,y, "Instances", obj_atk2); ///Creates Attack
inst.direction = image_angle; ///Sets the Attack to fire from the Object's Front
inst.image_angle = image_angle; ///Sets the Attack Angle to the Object Angle
}
if(keyboard_check(vk_escape)){ ///(This is here for later when I was going to have set up an input to close the game)
}
move_wrap(true,true,sprite_width/2); ///Wraps the Object when passing the screen boundary
Collision with obj_aster1 (The Asteroid Object)
instance_destroy();
repeat(10){
instance_create_layer(x,y,"Instances", obj_debris);
obj_aster1 (The Asteroid Object)
Create ///Positioning and Movement
sprite_index = choose( ///Chooses Sprite from inputted catalog
spr_aster1, (Medium Asteroid)
spr_aster2, (Huge/Sans Asteroid, the one Targeting other Objects)
spr_aster3 (Small Asteroid)
);
direction = irandom_range(0,359); ///Chooses a random direction (0=360)
image_angle = irandom_range(0,359); ///Chooses random image position (0=360)
speed = 1;
Step ///Wrap & Rotate
move_wrap(true,true,sprite_width/2); ///Wraps the Object when passing the screen boundary
image_angle = image_angle + 1;
obj_atk2 (The Bullet, numbered because I am planning to implement a few different Attacks)
Create ///Speed
speed = 6;
Collision with obj_aster1
instance_destroy();
with(other){
instance_destroy();
if(sprite_index == spr_aster2){
repeat(2){ ///Makes the sprite split into two
var new_aster = instance_create_layer(x,y, "Instances", obj_aster1);
new_aster.sprite_index = spr_aster1;
}
}
else if(sprite_index == spr_aster1){
repeat(4){ ///Makes the sprite split into two (I chose 4 out of preference, and yes, I do realize the comment says two instead of four)
var new_aster = instance_create_layer(x,y, "Instances", obj_aster1);
new_aster.sprite_index = spr_aster3;
}
}
repeat(4){
instance_create_layer(x,y,"Instances", obj_debris);
}
}
///WHY DOES SANS HAVE AIMBOT (Comment left in)
Outside Room
instance_destroy();
I've also looked over the coding quite a few times, and everything seems to match what the tutorial shows (Although I have been known to miss silly little differences multiple times)