Find Jobs
Hire Freelancers

Director Code v11.5 - help needed

$30-250 USD

Closed
Posted about 14 years ago

$30-250 USD

Paid on delivery
Hi, i am in the middle of creating a game for a first year university project. I have had trouble geting a bullet to fire out of a moving sprite which is controlled by the keyboard arrows. Here is the script attached to the moving sprite, property pMySprite, pSpeed on beginsprite me pSpeed = 5 pMySprite = sprite([login to view URL]) end on exitframe case TRUE of (keypressed(124)) : [login to view URL] = [login to view URL] + pSpeed [login to view URL] = 1 (keypressed(123)) : [login to view URL] = [login to view URL] - pSpeed [login to view URL] = 0 (keypressed(125)) : [login to view URL] = [login to view URL] + pSpeed (keypressed(126)) : [login to view URL] = [login to view URL] - pSpeed end case end The above code simply moves the sprite arround the screen, below is the code ive attached to the bullet... property pTankShell , pSpeed, pTop, pBottom, pFire on beginsprite me pTankShell = sprite([login to view URL]) pSpeed = 15 pTop = - 10 pBottom = 610 pFire = false end on exitframe me if keypressed (49) then Shoot if [login to view URL] > pBottom then [login to view URL] = pTop pShoot = false end if end if on Shoot [login to view URL] = sprite(3).locv + pSpeed [login to view URL] = sprite(3).loch end All this code seems to do is relocate the bullet to the postition of the moving sprite. how could i have the bullet moving down to the bottom of the stage from the position of the moving sprite, then reseting to the top of stage until the key is pressed again. Any help would be appriceated for this project needs to be in for monday. thanks very much,
Project ID: 678509

About the project

Remote project
Active 14 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs

About the client

Flag of UNITED KINGDOM
N.Ireland, United Kingdom
5.0
1
Member since Jun 5, 2006

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.