I don't even know where to start. When I set Right-Click - Create Instance of object obj_floor, it doesn't create any blocks - to an extent.
It only creates the block on the player when you right click on the player. How would I change it so it creates a block where the mouse is clicked?
And too where I can't create a block on the player, if that's possible.
How to create blocks in-game?
Started by _228221, Sep 17 2011 01:26 AM
4 replies to this topic
#1
Posted 17 September 2011 - 01:26 AM
#2
Posted 17 September 2011 - 01:31 AM
here:
thats all i can think of righ now
if mouse_check_button_pressed(mb_left) && !place_meeting(mouse_x,mouse_y,OBJECTBLOCK)
{
instance_create(mouse_x,mouse_y,OBJECTBLOCK);
}
thats all i can think of righ now
#3
Posted 17 September 2011 - 01:46 AM
here:
if mouse_check_button_pressed(mb_left) && !place_meeting(mouse_x,mouse_y,OBJECTBLOCK) { instance_create(mouse_x,mouse_y,OBJECTBLOCK); }
thats all i can think of righ now
Do I apply it to the player in an Execute a piece of code?
'cuz it doesn't work. ):
It still only puts the object over the player, and it isn't aligned to the grid. I should have included that in the first post though...
#4
Posted 17 September 2011 - 01:49 AM
Make it global right click instead of regular right click and make instance create of the block.
#5
Posted 17 September 2011 - 01:57 AM
here:if mouse_check_button_pressed(mb_left) && !place_meeting(mouse_x,mouse_y,OBJECTBLOCK) { instance_create(mouse_x,mouse_y,OBJECTBLOCK); }
thats all i can think of righ now
Do I apply it to the player in an Execute a piece of code?
'cuz it doesn't work. ):
It still only puts the object over the player, and it isn't aligned to the grid. I should have included that in the first post though...
instance_create(obj_mouse.x,obj_mouse.y,OBJECTBLOCK);
proly a code to snap it but i use another object... obj_mouse
THEORETICAL CODE
if mouse_x>=x+16 {x+=16;}
if mouse_y>=y+16 {y+=16;}
if mouse_x<=x-16 {x-=16;}
if mouse_y<=y-16 {y-=16;}
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











