The Daily Click ::. Forums ::. Klik Coding Help ::. Shoot when on Screen
 

Post Reply  Post Oekaki 
 

Posted By Message

Metal Maiden



Registered
  10/09/2002
Points
  900
24th November, 2003 at 02:16:18 -

Yo. Dumb question here.

I have this monster that shoots when you're far and uses a large melee attack when you're too close. The monster is located further within the level, and, with my current setup, he shoots objects every 2'25 seconds, even when not on screen. But I don't want him to!

I would like it to only have him shoot when he is visible on the screen, now, how would I go about that? Thanks guys.

 
Death in the air
Strapped in the electric chair
This can't be happening to me
Who made you God to say
"I'll take your life from you!!"

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
24th November, 2003 at 02:45:41 -

* enemy.x =< X right Frame
+ enemy.x => X Left Frame
+ enemy.y => Y bottom Frame
+ enemy.y =< Y top frame

Then allow shooting. There's probabley a simplier way somewhere - but make sure you pick "coordinate of visible edge" under frame expressions.

-Andy

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Metal Maiden



Registered
  10/09/2002
Points
  900
24th November, 2003 at 02:54:05 -

I must be dumb, but I coulnd't figure how to get that expression to work..

 
Death in the air
Strapped in the electric chair
This can't be happening to me
Who made you God to say
"I'll take your life from you!!"

Alex Scobell



Registered
  22/07/2002
Points
  717
24th November, 2003 at 04:29:18 -

You could try saying if he's to close to the windows edge don't shoot, that might be simpilar for you since you can't figure out Andy's code.

 
www.sunfungames.50megs.com - The Secret of T.E.L.X coming soon!

Lew



Registered
  06/01/2002
Points
  1014
24th November, 2003 at 04:48:13 -

I think Andy's one will only work in MMF. If you don't have it, GET IT BOY!

 
<--intelligent, witty comment here-->

AndyUK

Mascot Maniac

Registered
  01/08/2002
Points
  14586

Game of the Week WinnerSecond GOTW AwardHas Donated, Thank You!VIP Member
24th November, 2003 at 07:13:29 -

its not so easy to get hold of mmf you know

 
.

Metal Maiden



Registered
  10/09/2002
Points
  900
24th November, 2003 at 12:39:10 -

Yea, I have tgf. I was waiting to get mmf when the second one comes out.

Anyways, I wanted to know how to make an event where it finds the distance between
the knight and the monster. Maybe that'd be easier. I almost pulled it off but.....

 
Death in the air
Strapped in the electric chair
This can't be happening to me
Who made you God to say
"I'll take your life from you!!"

Assault Andy

Administrator
I make other people create vaporware

Registered
  29/07/2002
Points
  5686

Game of the Week WinnerVIP Member360 OwnerGOTM JUNE - 2009 - WINNER!GOTM FEB - 2010 - WINNER!	I donated an open source project
24th November, 2003 at 22:44:35 -

Maths, if you don't know the formula for that then there are many extensions that have that function built into them. Such as the advanced maths, the advanced direction something and mainly all the maths ones.

 
Creator of Faerie Solitaire:
http://www.create-games.com/download.asp?id=7792
Also creator of ZDay20 and Dungeon Dash.
http://www.Jigxor.com
http://twitter.com/JigxorAndy

Andy G



Registered
  07/07/2002
Points
  860
24th November, 2003 at 23:32:44 -

LLP, there's a distance formula that I actually got working not too long ago and it really wasn't that hard to impliment; and I'm not even that good at math. Just look up the distance formula on google or something and put it in. It's not so bad. And it works too!

 
Beach Invasion II will come out if you are lucky.

Alex Scobell



Registered
  22/07/2002
Points
  717
25th November, 2003 at 02:20:52 -

"its not so easy to get hold of mmf you know "

www.clickteam.com Pretty easy actually, I'm sure they'll ship most places.

 
www.sunfungames.50megs.com - The Secret of T.E.L.X coming soon!

Zane



Registered
  09/09/2003
Points
  1183
25th November, 2003 at 06:04:32 -

you could always make an active object the same size as the window, uncheck the follow the frame box and make it invisble. then only let the monster shoot if its overlapping the object.

Image Edited by the Author.

 
www.klikforever.co.uk
GO THERE!!!

Aali [Crazy_Productions]



Registered
  13/10/2002
Points
  843
25th November, 2003 at 07:04:08 -

distance = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))

use advanced maths object

 
"If Darl McBride was in charge, he'd probably make marriage unconstitutional too, since clearly it de-emphasizes the commercial nature of normal human interaction, and probably is a major impediment to the commercial growth of prostitution."
-- Linus Torvalds, December 5th 2003.

(Darl McBride is CEO of The SCO Group)


this place sucks but don't tell anyone, it's our little secret, ok?

Grazzum - Scorpion E



Registered
  25/10/2003
Points
  918
26th November, 2003 at 16:56:31 -

God I hate Factoring

 
n/a
   

Post Reply



 



Advertisement

Worth A Click