How to make a bullet fly in the direction in which the character looks

S

Sevonka

Guest
I do not know how to make a bullet fly, but was not in place
upload_2017-11-24_22-59-19.png

upload_2017-11-24_23-1-46.png
 
Last edited by a moderator:
U

Ukaygee

Guest
As maratae asked, how do you rotate the player? Do you have four player sprites? Do you use image_angle?

If you use image_angle, in the create event of the bullets, put
Code:
image_angle = (playerObjectName).image_angle
Please try being as clear as possible when posting a thread so we can help you!
 
S

Sevonka

Guest
As maratae asked, how do you rotate the player? Do you have four player sprites? Do you use image_angle?

If you use image_angle, in the create event of the bullets, put
Code:
image_angle = (playerObjectName).image_angle
Please try being as clear as possible when posting a thread so we can help you!
No, I didn't use image_angle
Yes, I have four player sprites
How to use image_angle?
 
U

Ukaygee

Guest
Ok, so you want to delete 3 of the sprites, and only keep one (preferably keep the one facing to the right.)
Now, this depends whether you would like the player to point toward the mouse, or to rotate using the arrow keys, or other keys.
DISCLAIMER *** Before proceeding, you will want to set the Sprite Origin of spr_player to Middle Centre.

If you would like the player to look towards the mouse, go into the STEP event of obj_player, and write the following.
Code:
image_angle = point_direction(x, y, mouse_x, mouse_y);
What this does, is every frame of the game, the rotation of the Sprite will we be modified to be facing toward the mouse icon. That's all you need!

If you want to use the arrow keys, go to the STEP event of obj_player and write the following.
Code:
if (keyboard_check(vk_left))
{
     image_angle = image_angle - 3;
}
if (keyboard_check(vk_right))
{
     image_angle = image_angle + 3
}
How this works, is that when you press the left arrow key, (vk_left stands for virtual key left) your image_angle will decrease. This will make the player rotate in an counter-clockwise direction. If you press the right arrow key, your image_angle will increase. This will make the player rotate in a clockwise direction.

If you need further explanation of image_angle, click here.

That's all you need! Let me know if you need any further assistance!
Good luck on your game, it's looking good!

Also, I see you're using Drag n Drop. Now, I have nothing against DnD, and I think it's a great tool for beginners to grasp the basics of GameMaker. However, I highly recommend, when you're ready, to create your projects using GameMaker Language. A great YouTuber called Shaun Spalding has a fantastic GMS2 platformer tutorial for absolute beginners, and he explains every single line of code in detail. You can find his GMS2 platformer tutorial series here.

Now, I do not want to push you into anything, take it at your own pace. I understand that you can view how your DnD looks in proper GML, so I encourage you to view your code in proper lines of code, so you can get an understanding of how things work. Also, have a look around Shaun's channel, and across YouTube for more useful tips n tricks!
 
Last edited by a moderator:
S

Sevonka

Guest
Also, I see you're using Drag n Drop. Now, I have nothing against DnD, and I think it's a great tool for beginners to grasp the basics of GameMaker. However, I highly recommend, when you're ready, to create your projects using GameMaker Language. A great YouTuber called Shaun Spalding has a fantastic GMS2 platformer tutorial for absolute beginners, and he explains every single line of code in detail. You can find his GMS2 platformer tutorial series here.

Now, I do not want to push you into anything, take it at your own pace. I understand that you can view how your DnD looks in proper GML, so I encourage you to view your code in proper lines of code, so you can get an understanding of how things work. Also, have a look around Shaun's channel, and across YouTube for more useful tips n tricks!
I'm very grateful to you,
But I use a trial version, and I can't create new sprites anymore
its so sad, I can download cracked version?

Also, I see you're using Drag n Drop. Now, I have nothing against DnD, and I think it's a great tool for beginners to grasp the basics of GameMaker. However, I highly recommend, when you're ready, to create your projects using GameMaker Language. A great YouTuber called Shaun Spalding has a fantastic GMS2 platformer tutorial for absolute beginners, and he explains every single line of code in detail. You can find his GMS2 platformer tutorial series here.

Now, I do not want to push you into anything, take it at your own pace. I understand that you can view how your DnD looks in proper GML, so I encourage you to view your code in proper lines of code, so you can get an understanding of how things work. Also, have a look around Shaun's channel, and across YouTube for more useful tips n tricks!
Maybe a better use gamemaker 8.1?
 
Last edited by a moderator:
U

Ukaygee

Guest
I highly recommend purchasing the full GameMaker Studio 2 program. If you can't purchase it, I would suggest using GM:S1, however that doesn't seem to be available for purchase anymore.

GameMaker Studio 2
Creator Edition: $39 12-month licence
Developer Edition: $99 Permanent Licence
Developer Edition: Mobile: $399 Permanent Licence
Console Edition: UWP: $399 Permanent Licence
Console Edition: PlayStation or Xbox: $799 12-month licence

I, personally, would recommend the Developer Edition $99 permanent licence. That is the edition I purchased, and it is a permanent licence.
You can use GameMaker 8, I think the comments I have made on this thread should work for that version.
 

TsukaYuriko

☄️
Forum Staff
Moderator
I'm very grateful to you,
But I use a trial version, and I can't create new sprites anymore
its so sad, I can download cracked version?
Maybe a better use gamemaker 8.1?
The Creator edition of GM:S 2 removes all feature restrictions and lasts for a year for merely $39. Perfect early Christmas present?

Keep in mind that software piracy is a crime. I doubt that potentially facing legal charges is in your best interest, not to mention that you will of course be banned from this community if you do so.
 
S

Sevonka

Guest
The Creator edition of GM:S 2 removes all feature restrictions and lasts for a year for merely $39. Perfect early Christmas present?

Keep in mind that software piracy is a crime. I doubt that potentially facing legal charges is in your best interest, not to mention that you will of course be banned from this community if you do so.
I buy license on this week man) Don't scare me))

I can all the projects created in the test version to synchronize with the steam version?
 
Last edited by a moderator:

TsukaYuriko

☄️
Forum Staff
Moderator
I buy license on this week man) Don't scare me))
You asked! :p

I'm not scaring anyone, merely answering your question whether you can use a crack or not with all consequences of either path included in full detail.

I can all the projects created in the test version to synchronize with the steam version?
If you're asking whether anything you made in the free version can be used in paid versions: Yes.
 
Top