The Daily Click ::. Forums ::. Klik Coding Help ::. Heat seeking projectiles with style.
 

Post Reply  Post Oekaki 
 

Posted By Message

Teh Keelor



Registered
  03/07/2003
Points
  333
12th July, 2003 at 21:24:04 -

I want to make a part in the game where missles are fired at you. I want the missles to veer off toward your charecter, but then keep going if they miss you. I can only get them to go directly to your ship (projectile always looks at ship). I got it to work pritty well by making it always look at the spot just behind you, but If you fly up towards the top of the screen, that spot will be on screen. Any Ideas? Im trying to find an example of what I want on a rom somewhere.

 
Image

"Don't push the Mario man!"

Teh Keelor



Registered
  03/07/2003
Points
  333
12th July, 2003 at 21:39:34 -

Oooo nevermind I got it.

*The Projectile must have a bouncy ball movement*

1.Every 3 Seconds = Create (Projectile) at (0,0 from Enemy gun)

2.Every .50 Seconds = Add 1 to alterable valu A of (Projectile)

3.Alterable Value A of (Projectile) is <= 2 = Look at (You)

 
Image

"Don't push the Mario man!"

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
13th July, 2003 at 02:04:57 -

Tequila - Instead of answering your own question, you should of just deleted this .

 
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

WesR



Registered
  15/06/2002
Points
  57
13th July, 2003 at 04:39:52 -

Yes, or you could've spent more time working on the problem instead of posting it.

 
n/a

:JULI@N:



Registered
  14/07/2002
Points
  641
13th July, 2003 at 20:22:01 -

"Tequila - Instead of answering your own question, you should of just deleted this"

Or don't delete it, it can help other people who view this

 
n/a

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
14th July, 2003 at 06:14:05 -

If you want to add even more 'style' I recommend using the Direction Calculator extension!

 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!

..:.Phox.:..



Registered
  18/02/2005
Points
  646

VIP MemberHero of TimeI like Aliens!Cardboard BoxAttention Getter
4th May, 2005 at 15:21:49 -

how do you do that?


 
Profile edited as it messed the layout of the site up.

Zi-Xiao



Registered
  29/07/2002
Points
  537

VIP Member
4th May, 2005 at 16:07:47 -

Using timers for movement events is usually a pretty sloppy way of doing movement. I suggest something like this:

+shoot a rocket+
- (Create ROCKET 0,0 from ROCKET LAUNCHER)
- (Set VALUE X of ROCKETS) to ((Y position of SHIP) - (Y position of ROCKET LAUNCHER))/2 + Random(20)
- (Set VALUE Y of ROCKETS) to -20 + Random(20)

+position the rocket+
If ((X position of ROCKETS) > X position of SHIP) AND ((Y position of ROCKETS) < (Y position of SHIP))
- Subtract 1 from (VALUE X of ROCKETS)

If ((X position of ROCKETS) < X position of SHIP) AND ((Y position of ROCKETS) < (Y position of SHIP))
- Add 1 from (VALUE X of ROCKETS)

Always
- Subtract 1 from (VALUE Y of ROCKETS)
- (X position of ROCKETS) to (X position of ROCKETS) + (VALUE X of ROCKETS)/5
- (Y position of ROCKETS) to (Y position of ROCKETS) - (VALUE Y of ROCKETS)/5

you may have to play around with the values when creating the rocket depending on how u want the rocket to move and the size of your screen. The rockets should move more realistically. Plus the code is much cleaner. I typed this up in a hurry so there may be mistakes but I'm sure you get the idea.

 
n/a

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
4th May, 2005 at 16:11:45 -

This is a tall order. Perhaps you should try asking that somewhere other than the lonely hearts column, after all projectiles with style would have heat thrown all over it, they hardly need to go and look for it.

 
n/a

..:.Phox.:..



Registered
  18/02/2005
Points
  646

VIP MemberHero of TimeI like Aliens!Cardboard BoxAttention Getter
5th May, 2005 at 14:29:38 -

Well SOOOOOOOOOOOOORRY Phizzy!

I just thought this place was the place for Q - A!

So I had a Q.

Jerry gave me the answer!

What's the BIG deal?

 
Profile edited as it messed the layout of the site up.

Muz



Registered
  14/02/2002
Points
  6499

VIP MemberI'm on a BoatI am an April FoolHonored Admin Alumnus
5th May, 2005 at 22:01:13 -

Yeah, get the direction calculator 2 in one of the bonus packs. Even comes with an example for this kind of thing.

Alternatively, you could code a full physics engine like I did. Object goes at steady velocity when it misses, code a bit of deceleration, then accceleration, then change the velocity .

 
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.

Image
   

Post Reply



 



Advertisement

Worth A Click