Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / The missile needs to launch up in the air with collision detection

Author
Message
PowerMan
19
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 7th May 2005 09:33
i have a missile that gets triggered when the craft hits a flag, at the moment a message gets printed out underneath the missile. What i want is when the ship hits the trigger the missile launch up in the air and delete when it is off screen.

maybe i will go on from here to try and add AI so it follows the craft around the screen and even add a smoke trail from the missile.

my code is below



if anyone can help i would appreciate it

Attachments

Login to view attachments
PowerMan
19
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 7th May 2005 09:34
sorry i forgot to add the craft to the media

Attachments

Login to view attachments
NanoBrain
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 9th May 2005 06:52
PowerMan,

In the code snippet below is the edited code you have been patiently waiting for. I have deleted both of your functions, as they were not needed, at least in the manner they were set up. I have added one new function, which is called launchmissle, a spin-off of your old function. It makes the missle to move and prints the text "launch missle" to the screen, when called.



To create this effect I have used a referance(boolean value) variable named launch, that as long as it is set to a value of 1, the launchmissle() function will be called. If the variable is set to anything else, the function will not be called.

There are two conditions to be met which alters the value inside launch. 1)launch = 0 and collision between the marker and player craft is true. This condition, being met, will change the value of launch to 1. 2) Missle goes completely out of screen(missle_y# < -42) This condition, being met, will set launch to 0 and the missle will be repositioned at its initial position.

There are plenty off REM comments of mine within your code, which will help navigate you to a good understanding of how the program works. The comments of mine look like this REM << a comment >>>>>>>>>>>>.


+NanoBrain+
PowerMan
19
Years of Service
User Offline
Joined: 22nd Jan 2005
Location: Manchester
Posted: 10th May 2005 02:52
tank you nanobrain that is great cheers, just what i needed i have learnt loads from that advice thankyou

Login to post a reply

Server time is: 2024-09-23 19:34:21
Your offset time is: 2024-09-23 19:34:21