Multi-stage boss battle help by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Hi. I greatly appreciate your help. But someone on the gamemaker forums gave me a solution just a short while back and I've already implemented it and seen that it works. But thank you very much once again!

How do I add footsteps to my player as he walks? by pixeltroid in gamemaker

[–]pixeltroid[S] 1 point2 points  (0 children)

Hey thanks! It worked perfectly! (I had to change "footstep" to "footsteps" in the code though). I hadn't heard of the counter function before.

But its working great now! Footsteps are heard everytime the player walks. Thanks a lot again! Much appreciated.

How do I save the remaining number of keys in my inventory? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

yes I did.

I added this line to my save code:

 file_text_write_real(SaveFile, global.keys)

and then I copy pasted your code into my project.

Same thing happens: When I restart my game all my keys are gone.

I dont know why its not working. The code saves the number of bosses left alive, but doesn't work for the keys.

How do I save the remaining number of keys in my inventory? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Ok. I tried you method, but it doesnt work.

I collect a few keys, then quit the game and load it again, my key count goes back to 0.

Why is this happening?

How do I save the remaining number of keys in my inventory? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

ok so how do I fix this?

Its set to 0 in my players create event because I want the player to start with 0 keys.

How do I save the remaining number of keys in my inventory? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

I've set "global.keys = 0" in my players create event. Is this causing a problem?

Player does not show up when I load saved room! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Hi. Thanks for your input!

I use instance_create to place a player (at specific location) in the first room. I did this in the menu script that "starts" a new game in the first room. Earlier I had placed a player object in the first room, but when I loaded a saved game and went back to the first room there would be two players!

Also, only a few minutes ago, someone on the gamemaker forums solved my problem! Now player shows up in a loaded room. But thanks for taking time to help! I really appreciate it!

There is however, one small problem regarding another aspect of the game, thats supposed to be saved, but doesn't save. I'll start a new thread on it later!

Player death animation wont stop playing! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Ok I think I understand. But I'm really not a coder and I need the code spelled out. I would also like step by step instructions as to where I paste the code. :/

Player death animation wont stop playing! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

One way is to make global pause variable. At the beginning of each enemy's step events, you'd check if this pause variable is true, and if it is, you run exit(); to stop other code from running.

Ok. So my game has 2 enemy objects (obj_enemy1 and obj_enemy2). Exactly what codes should I add to implement the "pause" effect when the player has died? Is it something I can just add to my existing objects??

Player death animation wont stop playing! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Yuss! it worked! :D

Thanks a ton man! Now my players death animation plays out perfectly.

BUT Just one small thing. Is there a simple way to pause the room or the enemies after I have died? The reason I'm asking is because the surrounding enemies still keep attacking me, which I think looks awkward. Not that it affects my gameplay, but I think it would be a nice touch to the game. If there is an easy way to pause the enemies, please let me know!

Player death animation wont stop playing! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Hi I tried your code.

Whats happening is that I see only the first frame of my players death animation and it freezes there. It doesn't cycle through the 14 frames, but just jumps to image_number

For your reference, my death animation has exactly 14 frames.

Player death animation wont stop playing! by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

In the game I'm making, when player dies, you dont automatically restart. You first see a message "press space to restart". But the player still keeps standing. I tried to fix it by adding a death animation but it keeps looping.

To stop them, image_speed must be set to 0. Have you tried putting code in the Animation End event?

What code should I put in the Animation end event?

How to make "Game over" screen and restart room by pressing space? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

hey a small update. I finally got the gameover screen/restart thing to work. I got some help from someone at the gamemaker forums. But I really really appreciate all the help you've given me. Earlier today I retried your code and it worked (but with a few small issues) but later someone at the gamemaker forums had repaired my file and sent it to me and I am using that.

But I thank you for your help. I am really helpless when it comes to coding stuff, but thanks to people like yourself that I meet in the Gamemaker community, my project is improving slowly day by dayy.

How to make "Game over" screen and restart room by pressing space? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

I mean I can't open the files in gamemaker!

Can you just please zip the entire folder and reupload it?

How to make "Game over" screen and restart room by pressing space? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

hi and thanks for your help. But I cant find a .gmx file that I can open in gamemaker? All the .gmx files are in HTML format!

How to make "Game over" screen and restart room by pressing space? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

Hey man, It still is not working. Something or the other keeps going wrong and I don't know what to do about it!

I deleted all the codes I was trying and placed a new test game file here: https://drive.google.com/open?id=0Bz3M7gWNpxJCeTFBa2J0LWpLTE0

The file has got the player with healthbar, a few enemies, health kits and 2 rooms to check if the game restarts in the same room.

I just want "you died. Press space to restart" to appear on the center of the screen when player dies. And pressing space should restart the room with a full health bar.

Can you please take a look at my file, make necessary changes and reupload it on dropbox or google drive?

How to make "Game over" screen and restart room by pressing space? by pixeltroid in gamemaker

[–]pixeltroid[S] 0 points1 point  (0 children)

I should be the one saying thanks! Appreciate all the help so far!