[help] how to create the same object in different directions

N

noiverm

Guest
hi i'm new to game maker programming and sometimes i get stuck in trouble like this.
Well, I want to create two spawners to create 1 object in 2 directions for a platform game

I have 2 obj_spawn and 1 obj_char.
to obj_spawn_A I make an instance_create of obj_char as long as I press Q
to obj_spawn_B I make an instance_create of obj_char as long as I press W
in the obj_char I have a create event to assign variables (gravity acceleration speed etc)
and in the steep event then I use the variables to assign an direction, for example
x + = 4 if Q was pressed
x- = 4 if W was pressed

but my problem is that when creating the object in both spawners, all the created objects go to the same direction


119595094_10220837152752363_5726806715917587530_n.jpg

somebody could help me?
 

SoapSud39

Member
In your spawner objects, you can put
with instance_create_etc(x, y, layer/depth, obj) {
image_xscale = etc.​
speed = etc.​
//according to which spawner​
}
The with clause will do the code to the created instance after its create event.
 
Top