Pirate Ship shooting Cannon ball

For questions about using Classic.

Post » Sun Mar 01, 2009 1:46 am

Ok so basically im trying to get a pirateship to shoot a cannon ball, simple right? I should use the

On key pressed space
spawn "cannonball"

type thing.

But for some reason it will not spawn?

http://files.filefront.com/Piratebattle ... einfo.html

I've tried spawning other objects without success. What am I doing wrong?
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Sun Mar 01, 2009 2:22 am

Your "Weapons" group is disabled. Right click it, go to edit group, and uncheck "Disable group by default"
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Mar 01, 2009 2:29 am

Thanks :D
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Sun Mar 01, 2009 2:32 am

Also any idea why the ship continues to move even when i do "On key release deactivate bullet"?
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Sun Mar 01, 2009 2:37 am

The "On key released" events shouldn't be sub-events. If a key is released, then the "Key is down" condition won't run, and thus the sub-events inside won't run either, therefore it won't know register when the key is released.
Moderator
B
98
S
37
G
19
Posts: 1,584
Reputation: 17,817

Post » Sun Mar 01, 2009 2:47 am

Ah i see, thanks.

Another question, when i change the ships direction, how do i make the cannon ball shoot in the other direction? Instead of always shooting to the right?


I changed the cannonball from a physics with bullet to just physics, and then used Always set force.
So how would I change the direction with that?


I want the cannonball to do a nice curve up and then down :?
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Sun Mar 01, 2009 7:53 pm

Anyone?
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Sun Mar 01, 2009 11:10 pm

you could attach a cannon so you could shoot at different angles. You could also use ball behavior to simulate the ballistics. Let the player adjust the cannon angle, and the physics or ball behavior (with high gravity settings) will take care of the arc for you.

B
2
S
1
G
3
Posts: 39
Reputation: 1,078

Post » Mon Mar 02, 2009 2:45 am

Genious! So what do I exactly make the turret out of? turret behavior? Also could you send me the sprite for that cannon. I'm kind of new to construct i need a more in depth explanation. :mrgreen:

EDIT:
So far I've gotten a cannon sprite and then Controlling it with when key down cannon.angle+2 and cannon.angle-2

when I angle the cannon to shoot on an arc, the ball doesn't change it's trajectory according to the angle, also how do i make the ball destroy itself after it goes through its arc to make it seem like it is "Hitting the water" or "Hitting a boat"
B
2
G
4
Posts: 34
Reputation: 1,118

Post » Mon Mar 02, 2009 6:32 am

[url:2c9a5dj7]http://www.mediafire.com/?sharekey=4e7756559772acd2d956df2962098fcb4dac8e31abb47b805be6ba49b5870170[/url:2c9a5dj7]

revised a few things for demonstration purposes. I get the feeling you're trying to do things the hard way. Try going through the GhostShooter and Platform School tutorials - you will find the answers to a great many questions by inspecting their properties in detail. No need to rush, Construct will get you there.
B
2
S
1
G
3
Posts: 39
Reputation: 1,078

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests