# isometric shooter help

2 replies to this topic

### #1 Pixel_Reaper

Pixel_Reaper

GMC Member

• GMC Member
• 40 posts
• Version:GM8

Posted 20 September 2012 - 09:41 AM

hey im busy making a isometric shooter, but i ran into a few problems

i want to make a projectile destroy itself after it has traveled a set distance(bullet_range)
if distance_to_point(point_of_creationx,point_of_creationy)>=bullet_range
{instance_destroy()}
how do i get the point it was created at?

also i use this to get the caracter to face in the right direction:
in step event:
if direction>337.5 or direction<22.5
{pd=0}
{if direction>22.5 and direction<67.5
pd=1}
{if direction>67.5 and direction<112.5
pd=2}
{if direction>112.5 and direction<157.5
pd=3}
{if direction>157.5.5 and direction<202.5
pd=4}
{if direction>202.5 and direction<247.5
pd=5}
{if direction>247.5 and direction<292.5
pd=6}
{if direction>292.5 and direction<337.5
pd=7}
in draw event:
if pd=0
{draw_sprite(sprite9,0,x,y)}
if pd=1
{draw_sprite(sprite10,0,x,y)}
if pd=2
{draw_sprite(sprite11,0,x,y)}
if pd=3
{draw_sprite(sprite12,0,x,y)}
if pd=4
{draw_sprite(sprite13,0,x,y)}
if pd=5
{draw_sprite(sprite14,0,x,y)}
if pd=6
{draw_sprite(sprite15,0,x,y)}
if pd=7
{draw_sprite(sprite8,0,x,y)}
but when the character stops moing it changes back to the starting sprite.
how do i get it to stay on the last used sprite?

my minimap is also acting weird
i use this:
draw_set_alpha(0.45)
draw_set_color(c_black)
draw_rectangle(view_xview + 5, view_yview + 60, view_xview + 110, view_yview + 160, 0);
draw_set_color(c_red)
draw_circle(Player.x/(room_width/200)+view_xview, Player.y/(room_height/100)+view_xview,5,0)
how do i get the circle representing the player to stay on the minimap?

Pixel_Reaper
• 0

### #2 Noele

Noele

GMC Mentor

• GMC Member
• 2352 posts
• Version:GM8.1

Posted 20 September 2012 - 10:52 AM

xstart and ystart contain the starting x,y for the instance - that is, the position in the room they were created at.
```if(distance_to_point(xstart,ystart) > 100){
// this instance is more than 100 pixels from its starting point
instance_destroy();
}```
Should do what you want.
• 0

### #3 Pixel_Reaper

Pixel_Reaper

GMC Member

• GMC Member
• 40 posts
• Version:GM8

Posted 20 September 2012 - 07:34 PM

thanks I will check that out
• 0

#### 0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users