Bullet movement

Discussion and feedback on Construct 2

Post » Wed Jun 13, 2012 2:54 am

Hi, just grabbed the free edition last night to have a look and so far I love the work flow Construct 2 offers. I went through the tutoirals and decided to try something simple to get the hang of stuff..

I started a small Space Invaders game, my problem is this - No matter what i do i can't make my bullets move in any direction but to the right. ive tried angles, acceleration changes, physics etc.. my bullets always spawn and start moving to the right no matter what angle i have rotated the bullet sprite. Would love some advice on this issue.. thanks!

AlienheadAlienhead2012-06-13 03:03:08
B
3
Posts: 7
Reputation: 339

Post » Wed Jun 13, 2012 3:13 am

the angle is the answer, for example make action set angel to 45 or 35 or to player.angle......

also the condition what condition have you used?? like when space is pressed ? or on start of layout put the .capx and we will help you ^^ also check this tutorial it has some idea of bullets
http://www.youtube.com/watch?v=z4nigiKN-eU

B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Wed Jun 13, 2012 3:26 am

Hi thanks for the reply. Im using the spacebar to spawn a bullet at the ship... its pretty simpel as the bullet should just move upward but it always moves tot eh right.. heres the capx file.. thanks again!

http://gothasoft.com/temp/si.capxAlienhead2012-06-13 03:27:32
B
3
Posts: 7
Reputation: 339

Post » Wed Jun 13, 2012 3:29 am

After the spawn action, add an action to the bullet: "set angle of motion: 270"
B
134
S
65
G
16
Posts: 1,765
Reputation: 19,188

Post » Wed Jun 13, 2012 3:35 am

Oh wow... i played with this for the last 8 hours and didnt realize that could be done.. was setting the initial rotation and nothing more.. Thanks so much alspal.
B
3
Posts: 7
Reputation: 339

Post » Wed Jun 13, 2012 3:40 am

here i fixed it:
https://dl.dropbox.com/u/67034121/scirra%20construct2/si.capx
some stuffs i made to make it better:
i changed the imagepoint1 from the ship, i made it on the place that the bullet should spawn.
also put a behavior on the bullet if it outside the layout it destroy.
also made the event of angle 270 or (-90 i think)..

B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Wed Jun 13, 2012 3:41 am

zsangerous thanks alot! this is an awesome community. Right now im determining how to add a timer/pause between firing the bullet.. as in traditional Space invaders you could have only one bullet on screen at once. might this be something i will have to write in code?Alienhead2012-06-13 03:46:25
B
3
Posts: 7
Reputation: 339

Post » Wed Jun 13, 2012 3:55 am

@Alienhead this can done with 1 condition only o.o
in the same event (press spacebar)
put another condition : system -> compare two value , then put first value bullet.count then = or < or anything then 2nd value 1 or 2 the bullets you want on the screen
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Post » Wed Jun 13, 2012 3:56 am

op equations in the condition table.. how awesome is this.. thanks guys.
B
3
Posts: 7
Reputation: 339

Post » Wed Jun 13, 2012 4:17 am

just an idea in the future put this :@ then the name of the people you want to see your comments like @zsangerous
so there will be a notification in my account to see who needs me ^^

also remember in construct2 you can do what ever you want (2d game) and some 3d examples :P
B
45
S
15
G
6
Posts: 795
Reputation: 11,935

Next

Return to Construct 2 General

Who is online

Users browsing this forum: TheRealDannyyy, Zonacas and 15 guests