Game Maker 8.1: How to Create Shake Screen.

Channel:
Subscribers:
268
Published on ● Video Link: https://www.youtube.com/watch?v=5lcRUsbT1DU



Duration: 27:36
164 views
0


Visit my MC Anime site: https://mcanime1.wixsite.com/mcanime

Paypal Donate: http://bit.do/fkPAb

GM81 File: https://bit.ly/2ROqaYl

Note & Code File:

obj_shake, no sprite image required.

Events:

Create

Actions:

alarm[0] = 30;

Events:

Alarm 0

Actions:

view_xview = 0;
view_yview = 0;

Destroy Self

Events:

Step

Actions:

view_xview = random_range(-4,4);////If you take the numbers up, the screen will shake more, but only on images that use the view_xview and view_yview and if the room does not use d3d. Meaning, if you have an object or objects they will shake. This is used in end game room; d3d is turn off, and there is a object title in room, that will shake without the use of xview and yview.
view_yview = random_range(-4,4);


obj_shake2

The only thing different is the Actions for random range,

view_xview = random_range(-20,20);
view_yview = random_range(-20,20);///This is for end game room, Shakes alot more.

obj_facehit

Events:

Create

Actions:

Create Instance

Self

object: obj_shake

x: 0

y: 0

check Relative

Okay for any image that uses the Step and Draw and uses x and y view, if you do not want them to shake on screen, such as your inventory boxes or ammo count, just do this,

Delete your step info, and x and y view code. Use only the Draw for Event, then in the Actions, use this code for Draw, draw_sprite(sprite_index, image_index, x, y); these images on screen when you get hit will not shake, because you are not using the x and y view.

Example

obj_havegun2

Events:

Draw

Actions:

draw_sprite(sprite_index, image_index, 500, 200); ///the 500 and 200 are the horizontal and vertical location on screen. Just put in your x and y location.

Change something, which was not on video.

obj_faces, obj_healhim, I took out the step and change the Draw, so they will not shake, only the facehit will shake. If you want the obj_faces and obj_healhim to shake, just add the x and y views. Download my previous Game Maker link, to copy the Step and Draw Event back into the new_shake game maker to make those images shake using x and y views. It only makes sense when you hit something that his face will shake. Plus, there are three images of his face using different depths, and with all three of his face images shaking at once, it looks mess up.

Also in the obj_facehit I added code to deactivate the other faces when you get hit so it does not look so mess up with images behind the facehit.

Events:

Create

Actions:

instance_deactivate_object(obj_faces);

instance_deactivate_object(obj_healhim);

after the alarm stops and add them back in.

instance_activate_object(obj_faces);

instance_activate_object(obj_healhim);




Other Videos By MC Designs


2020-06-06Game Maker Studio: How to Create Moving Platforms?
2020-05-30Game Maker Studio: How to Make your Characters Flash, when getting Hit?
2020-05-30Game Maker Studio: How to Create a Swing Axe?
2020-05-23Game Maker Studio: How to Move on Rope?
2020-05-17Game Maker Studio: How to Move on Steps & Slopes?
2020-05-15Game Maker Studio: How to Move Up & Down on a Ladder & a Shortcut?
2020-05-09Game Maker Studio: How to Collect all items in the Room for Door to Open?
2020-05-09Game Maker Studio: How to Use Hp for your Characters?
2020-05-01Game Maker Studio: How to Create Animated Backgrounds.
2020-04-25Game Maker 8.1: How to Create Fire Background Particles.
2020-04-19Game Maker 8.1: How to Create Shake Screen.
2020-04-11Game Maker 8.1: How to Create Pause Screen for Both Rooms.
2020-04-04Game Maker Studio: (Part 3) How to Create Virtual Keys for Android?
2020-03-28Game Maker 8.1: Understanding Hit Points, & Create Bubble Head with Sound Effects.
2020-03-21Game Maker 8.1: How to Create Hitpoints for Monsters & Barrels.
2020-03-14Game Maker 8.1: How to Create Fade In, & a Flashing Dead Screen.
2020-03-07Game Maker 8.1: How to Create Rollover Buttons, & Animate Weapons In.
2020-02-29Game Maker 8.1: How to Create Custom Pause for 8.1 & Timer.
2020-02-22Game Maker 8.1: How to Fix Cursor Glitch, Hide & Reveal Inventory Glitch, & Pause Game.
2020-02-15Game Maker 8.1: How to Create a Cursor, Hide & Reveal Inventory, & Fix Load Glitch.
2020-02-09Game Maker Studio: (Part 2) How to Create Virtual Keys for Android?



Tags:
windows
pc
computer
move
maze
learn
teach
find
d3d
code
create
object
fps
sprite
game
maker
place
set
fake
check
start
gm81
animate
in
alarm
switch
mouse
die
dead
destroy
number
var
before
change
pause
new
room
player
end
instance
level
background
image
view
shake
screen
drawn
draw
hit