C
Chatterb0x
Guest
Hey gang,
My game is composed of three background objects: rocks, trees, and blossoms. The blossoms are separate objects because enemy blood splatters against it. Initially, the player object moved across the level. Now I've given the background objects a global hspeed to give the illusion of movement. There is just one problem.
The objects don't move in sync! Notice the blossoms in this gif.
http://giphy.com/gifs/blind-samurai-hspeed-3o7TKN1QOUUy94jkvC
The blossom object moves 'off' the branches.
I've put plenty work into wrapping objects (thanks again GM community) but am considering Plan A.
Information about object: obj_blossom5
Sprite: spr_blossom5
Solid: false
Visible: true
Depth: -2
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
///Setting image_alpha
image_alpha = 0;
//Creating the surface
surface = surface_create(sprite_width, sprite_height)
Begin Step Event:
execute code:
hspeed = global_speed;
move_wrap(true, false, 0);
if(game_start){
surface_set_target(surface);
draw_clear_alpha(0,0);
draw_sprite(spr_blossom5,image_index,0,0);
surface_reset_target();
}
Other Event: Game End:
execute code:
///Prevent memory leak.
surface_free(surface);
Draw Event:
execute code:
///Draw surface
if(game_start == 1){
image_alpha += .05;
draw_surface(surface,x,y)
}
My game is composed of three background objects: rocks, trees, and blossoms. The blossoms are separate objects because enemy blood splatters against it. Initially, the player object moved across the level. Now I've given the background objects a global hspeed to give the illusion of movement. There is just one problem.
The objects don't move in sync! Notice the blossoms in this gif.
http://giphy.com/gifs/blind-samurai-hspeed-3o7TKN1QOUUy94jkvC
The blossom object moves 'off' the branches.
I've put plenty work into wrapping objects (thanks again GM community) but am considering Plan A.
Information about object: obj_blossom5
Sprite: spr_blossom5
Solid: false
Visible: true
Depth: -2
Persistent: false
Parent:
Children:
Mask:
No Physics Object
Create Event:
execute code:
///Setting image_alpha
image_alpha = 0;
//Creating the surface
surface = surface_create(sprite_width, sprite_height)
Begin Step Event:
execute code:
hspeed = global_speed;
move_wrap(true, false, 0);
if(game_start){
surface_set_target(surface);
draw_clear_alpha(0,0);
draw_sprite(spr_blossom5,image_index,0,0);
surface_reset_target();
}
Other Event: Game End:
execute code:
///Prevent memory leak.
surface_free(surface);
Draw Event:
execute code:
///Draw surface
if(game_start == 1){
image_alpha += .05;
draw_surface(surface,x,y)
}