Hy
Ich habe programmiert das mein player pfeile abschießt und es funktioniert auch ganz gut.
Jedoch wollte ich durch
Hab es so probiert:
Alles anzeigen
Jedoch hab ich das problem das ich nicht weiß wie ich es machen kann das wenn der player
Ich habe programmiert das mein player pfeile abschießt und es funktioniert auch ganz gut.
Jedoch wollte ich durch
global.item
machen das er nur maximal 5 pfeile besitzen kann und auch abfeuern kann und nicht mehr.Hab es so probiert:
GML-Quellcode
- if global.lastpressed=="right" && global.item <= 5
- {
- if (global.item >= 0)
- {
- global.item-=1;
- instance_create(x,y,obj_player_shoot_right)
- with instance_create(x,y+30,obj_bullet_right)
- {
- direction=0;
- hspeed=8;
- }
- }
- }else
- {
- if (global.item >= 0 )
- {
- global.item-=1;
- instance_create(x,y,obj_player_shoot_left)
- with instance_create(x,y+30,obj_bullet_left)
- {
- hspeed-=8;
- direction=180;
- }
- }
- }
- if (global.item == 0 )
- {
- ///Keine Ahnung wie ich es machen kann hab es mit instance_deactivate_object probiert ging aber nicht
- }
Jedoch hab ich das problem das ich nicht weiß wie ich es machen kann das wenn der player
0 pfeile
hat nicht mehr feuern kann. hab es mit instance_deactivate
probiert aber komm nicht voran bitte um hilfe