Laser that bounces off of surfaces

For questions about using Classic.

Post » Thu May 20, 2010 10:07 am

I want to to do this:


[size=85:hb2dmf3t](The circle represents the player. The black line is a gun. The white blocks are platforms/obstacles.)
[/size:hb2dmf3t]
I want to make a game where the player can shoot a laser and that bounces off of surfaces. I don't know where to start.

I tried using the ball movement, but that presented a lot of problems. For example, if the player moved, the laser would stop being a straight line.

Secondly, you have to set the speed really slow in order for it to look like a line rather than a bunch of circles being fired. I want the laser to come out fast. Not instant hit, but fast enough so that the player can see the laser actually bounce off of the wall.

I've tried other things like the line object, but so far everything I've tried hasn't worked. I'm stumped. Could someone maybe post an example to show me how I'd accomplish this?
B
2
S
2
G
4
Posts: 153
Reputation: 1,756

Post » Thu May 20, 2010 8:20 pm

Intriguing problem. Here's an example:
[url:7vbv9bhb]http://dl.dropbox.com/u/5426011/examples/Lazer.cap[/url:7vbv9bhb]
Req. 0.99.84
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Thu May 20, 2010 10:37 pm

The way I would do it, would be to create some simple laser shooting system (that I don't have the time to think up right now) that only shoots in a straight line (without bounces as such), as soon as it hits an obstacle, spawns another version of the laser at the new bounce angle, which proceeds to go in a straight line again until it hits an obstacle.
I'm sorry I can't help much more than that, quite busy at the moment, however this cap I made might help you get the angle of bounce that you want

[url:1qn98qpk]http://dl.dropbox.com/u/1289341/Angle.cap[/url:1qn98qpk]
B
3
S
2
G
5
Posts: 351
Reputation: 2,377

Post » Sat Oct 24, 2015 7:31 pm

Does anyone has the capx?
B
85
S
31
G
23
Posts: 384
Reputation: 19,092

Post » Sat Oct 24, 2015 7:50 pm

There is no capx. This was for Construct Classic, but the cap file link still works.
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Sun Oct 25, 2015 4:20 am

@R0J0hound Can I import the cap to Construct2?
If not, can you please send me a screenshot of the code?

thanks,
B
85
S
31
G
23
Posts: 384
Reputation: 19,092

Post » Sun Oct 25, 2015 6:17 am

It's only openable in construct classic. I don't have access to it right now to take a pic. Have you tried searching the forum for laser? There are capx examples that are similar.
B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Sun Oct 25, 2015 9:50 am

B
79
S
24
G
54
Posts: 4,753
Reputation: 40,769

Post » Sun Oct 25, 2015 4:48 pm

@R0J0hound thanks a lot
B
85
S
31
G
23
Posts: 384
Reputation: 19,092


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests