The Daily Click ::. Forums ::. Klik Coding Help ::. rotate object toward position when object is in the window
 

Post Reply  Post Oekaki 
 

Posted By Message

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th May, 2004 at 14:01:49 -

I want to make an enemy rotate toward a position when player is in the window (not the playfield).And I want it to stop when the player leaves the window.

I have made the enemy a bouncing ball, and its no prob to make it rotate using the always events or something simelar, but I cant make it work with player is inside the window. I have tried this event: "player" is getting closer than 0 pixels from windows edge = rotate "enemy" towards player. And I did the negate to make it stop when player leaves, but that didnt work, he just ignores the player. How can I make this work with just some events or another easy way. Oh and I use MMF and I do have the directional calculator

 
http://www.robocaptain.com

X_Sheep

I had a custom rating before it was cool

Registered
  01/03/2004
Points
  1313

VIP MemberPicture Me This -Round 23- Winner!Dos Rules!
27th May, 2004 at 14:34:26 -

If X of enemy is > than X of player - (window X size / 2) AND
If X of enemy is < than X of player + (window X size / 2) AND
If Y of enemy is > than Y of player - (window Y size / 2) AND
If Y of enemy is < than Y of player + (window Y size / 2) THEN
*thing*

Change the (window X size / 2) and the (window Y size / 2) to the original value


 
a/n

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th May, 2004 at 14:47:39 -

that really doesnt work. Now he always follows me, even outside of the window. And I want to make a negate event where the enemy stops when he is outside

 
http://www.robocaptain.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
27th May, 2004 at 15:04:52 -

What you did was right - negate the 'Player is getting closer than 0 pixels' condition. But I don't understand what you mean about ignoring the player - I made a test game and it worked fine.

 
n/a

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th May, 2004 at 15:18:33 -

Did it work for you? This is how my event looks like:
Alterable value A of "group good" = 0 AND "Hit poit" is getting closer than 0 pixels from windows edge DO THIS: Rotate "group bad" towards 0,0 "hitpoint" When I do this the enemy just leaves out of the screen (using the bouncing movment)

(Hit point: The position I want the enemy to go)

 
http://www.robocaptain.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
27th May, 2004 at 15:39:28 -

That's because you didn't tell the enemy to Stop... of course it's going to go out of the screen :|

 
n/a

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th May, 2004 at 15:42:30 -

that is not the problem, the problem is that It wont rotate towards the active object when the active object is in the screen. read the above for more details.

 
http://www.robocaptain.com
   

Post Reply



 



Advertisement

Worth A Click