GameMaker 日本語掲示板

パーティクルを使用すると不規則にGUIがちらつく / 2

14 コメント
views
17 フォロー
2

パーティクルObjのcreate_event

pp=global.main_player
col_ten=make_color_rgb(255,170,60);

FirstParticleSystem = part_system_create();
part_system_depth(FirstParticleSystem,-500);
first_particle = part_type_create();

part_type_shape(first_particle,pt_shape_pixel);
part_type_scale(first_particle,1,1);
part_type_size(first_particle,1,1,0,0);//wigleとは反復のことらしい
part_type_color2(first_particle,col_ten,col_ten);
part_type_alpha3(first_particle,1,1,0.8);//透明度
part_type_speed(first_particle,3,5,-0.015,0);//粒子速度
part_type_direction(first_particle,35,55,0,0);//方向
part_type_gravity(first_particle,0.04,-90);//重力。強さと、方向
part_type_orientation(first_particle,0,0,0,0,false);//回転
part_type_life(first_particle,20,30);//寿命
part_type_blend(first_particle,false);//ブレンド

//ここからエミッタ
first_emitter = part_emitter_create(FirstParticleSystem);
part_emitter_region(FirstParticleSystem, first_emitter,  x-1, x+1, y-1, y+1, ps_shape_line, ps_distr_linear);

パーティクルObjのuser_event0

pp=global.main_player
pp_tg=global.main_player.target_enemy

//以下プレイヤーの攻撃方向と対象エネミーの位置を反映させる処理
part_system_depth(FirstParticleSystem,-pp.play_y+4);
part_emitter_region(FirstParticleSystem, first_emitter,  pp_tg.play_x-1, pp_tg.play_x+1, pp_tg.play_y-52, pp_tg.play_y-52, ps_shape_line, ps_distr_linear);
if(pp.doujiosi_bottan=1||pp.doujiosi_bottan=11||pp.doujiosi_bottan=12){
	part_type_direction(first_particle,0,20,0,0);
}
			
if(pp.doujiosi_bottan=2||pp.doujiosi_bottan=22||pp.doujiosi_bottan=21){
part_type_direction(first_particle,160,180,0,0);
}
			
if(pp.doujiosi_bottan=3||pp.doujiosi_bottan=33||pp.doujiosi_bottan=34){
	part_system_depth(FirstParticleSystem,-pp.play_y-1);
	part_type_direction(first_particle,250,290,0,0);
	//した
}
			
if(pp.doujiosi_bottan=4||pp.doujiosi_bottan=44||pp.doujiosi_bottan=43){
	part_emitter_region(FirstParticleSystem, first_emitter,  pp_tg.play_x-1, pp_tg.play_x+1, pp_tg.play_y-32, pp_tg.play_y-32, ps_shape_line, ps_distr_linear);
part_type_direction(first_particle,70,110,0,0);	
	//上
}
				
if(pp.doujiosi_bottan=13||pp.doujiosi_bottan=31){
part_system_depth(FirstParticleSystem,-pp.play_y-1);
	part_type_direction(first_particle,315-10,315+10,0,0);
	//右下
}
if(pp.doujiosi_bottan=14||pp.doujiosi_bottan=41){
		part_emitter_region(FirstParticleSystem, first_emitter,  pp_tg.play_x-1, pp_tg.play_x+1, pp_tg.play_y-32, pp_tg.play_y-32, ps_shape_line, ps_distr_linear);
	part_type_direction(first_particle,35,55,0,0);
	//右上
}
if(pp.doujiosi_bottan=23||pp.doujiosi_bottan=32){
	part_system_depth(FirstParticleSystem,-pp.play_y-1);
	part_type_direction(first_particle,225-10,225+10,0,0);
	//左下
}
if(pp.doujiosi_bottan=24||pp.doujiosi_bottan=42){
	part_emitter_region(FirstParticleSystem, first_emitter,  pp_tg.play_x-1, pp_tg.play_x+1, pp_tg.play_y-32, pp_tg.play_y-32, ps_shape_line, ps_distr_linear);
	part_type_direction(first_particle,135-10,135+10,0,0);
	//左上
}
//方向と位置が決まったので80個生成
part_emitter_burst(FirstParticleSystem, first_emitter,first_particle,80);
通報 ...