• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Graphics How to make blind spot in top down shooter

S

silla

Guest
can game maker create blind spot one the player back and behind walls?
I googled around but cannot find one.
all games i saw made by GM has only cycle around player view.
 
D

DyingSilence

Guest
This is FOV (Field Of View) algoritm, you have to make it on your own.
The game i'm currently making - Hopeless Descent - is a top down shooter with some FOV working.

Wanna some code snippets?
 

Yal

šŸ§ *penguin noises*
GMC Elder
A really simple start is to have a "obstacle" parent object that walls, bushes/trees and other view-obscuring stuff inherits from. Then you could use some code in the draw event of enemies like this:
Code:
if(collision_line(x,y,obj_player.x,obj_player.x,parent_obstacle,false,false) != noone){
  exit
}
else{
  /*put your normal drawing code here*/
}
You could easily have a blind spot behind the player by having an invisible obstacle object move around so it's always right behind the player.
 
S

silla

Guest
just starting here, thanks. now GM win Unity for my first game.
 
Top