E
Ends
Guest
Code:
p = obj_player1
t = obj_player1_trail
if keyboard_check(vk_down){ speed = 2;}else{speed = 4;}
if keyboard_check(vk_left){direction += 8}
if keyboard_check(vk_right){direction -= 8}
if(instance_exists(p) == true){
instance_create(p.x,p.y,t)
}
Overview: I have a square object (obj_player1) 8x8 that turns left or right at a 360 angle. I would like to destroy obj_player1 when it touches obj_player1_trail.
Problem: When I implement an if statement of instance_place(p.x,p.y,t), it is created on the location of obj_player1. I need to destroy obj_player1 when it touches obj_player1_trail. Unfortunately, obj_player1 gets destroyed instantly.
Goal: I need to find a way to create the instance of obj_player1_trail 8 pixels behind obj_player1 depending where obj_player1 is facing. What is the best/easiest way of implementation?
Thanks in advanced,
Steven