~Hakurei Shrine~ > Rika and Nitori's Garage Experiments
※ Danmakufu Q&A/Problem thread 3 ※
<< < (4/366) > >>
Drake:
GetPlayerObjectID() gets the player object ID, so you can use ObjMove_SetPosition() to move them at the start of the stage script.
Random Sphere:
How can I modify an object  with a laser (ex. if a bullet is close to a laser, the bullet is destroyed)?
Badz:

--- Quote from: Sphe on February 09, 2016, 04:53:57 PM ---How can I modify an object  with a laser (ex. if a bullet is close to a laser, the bullet is destroyed)?

--- End quote ---

IsIntersected_Obj_Obj might be the solution to your problem. You could use it in a loop to check if a bullet is intersecting with the laser, and do something (in this case, destroy the bullet) if that's the case.
Random Sphere:
Thanks :D And homing bullets? How do they work?
Helepolis:

--- Quote from: Sphe on February 14, 2016, 09:19:46 AM ---Thanks :D And homing bullets? How do they work?

--- End quote ---
Please define though for which purpose you want to use them. Do the bullets home accurately (like Reimu's homing amulets) or only upon firing (so the player can graze them). The latter is achieved by calculating the angle between the object bullet and player using: GetAngleToPlayer(obj); or if you're happy with manual labour using: atan2(y1-y2,x1-x2);  when setting the angle of the object bullet. Where x/y positions of the object + player is filled in.

Example:

--- Code: ---let dir = GetAngleToPlayer(obj);
ObjMove_SetAngle(obj,dir);

or

let dir = atan2(GetPlayerY-ObjMove_GetY(obj),GetPlayerX-ObjMove_GetX(obj));
ObjMove_SetAngle(obj,dir);
--- End code ---


Edit: Thanks Drake for reminding me GetAngleToPlayer(obj). Keep forgetting about that one.

Navigation
Message Index
Next page
Previous page

Go to full version