Pages: 1
Topic closed
i need some help making lazer guns enemy ships, and changing levels and possibly cutscenes
Offline
You need sprites?
This doesn't really belong in advanced topics, unless you mean a laser system that bounces off reflective surfaces
Offline
yea i need a lazer system that bounces of objects and also
AI ships that fire them as well
Offline
ferretron5 wrote:
yea i need a lazer system that bounces of objects and also
AI ships that fire them as well
Hi ferretron5 - It sounds like you are trying to build a fairly complex game! I don't see any projects currently on your account so it's impossible for me to judge your experience level. If this is your first game, you may want to start off a little simpler.
Simple bouncing (but not very realistic) can be done by just rotating the sprite so it faces the other direction, plus maybe a random value. Take a look at this project for an example of that method.
http://scratch.mit.edu/projects/Paddle2See/476371
The mice bounce off of the walls using that simple method. I have several other projects that use more complicated (and more realistic) bouncing techniques. Just look around in my account and you'll find them.
Offline
You mean something like a laser pathway shooting ship that's laser can be ricochetted off of reflective surfaces, and if it hits the cockpit or the other ship's fuel tank, it'll blow up? If you knew angles very well, I can see it being possible, and also a color sensor that moves it away from a ship if it hits it wrong seems easy to do. Do you happen to know reflection angle calculations? I know the basics like the angle of incidence of a light beam (which in this case is the laser) is equal to the angle of reflection from a perpendicular point to the flat surface of the ship, and if you can understand that, I think you can make this game. The AI part on the other hand could be 3 scripts, where the ships moves forward and fires at you, moves away and fires at you or stands still and fires at you, and then it could perform a random action every couple of seconds.
Offline
The problem with reflections is that due to angles of the ships curves and such, it is almost impossible to get an accurate projectory. Also, they somtimes get stuck inside ships in scratch. I would suggest somthing simpler, like Paddle said.
Offline
For lack of a better curved explanation of lasers reflecting, the singular point at which a laser strikes a circular surface would be the point where the ray hits, obviously, and the angle from the center of the ship to that certain point elongated could be the reflective normal line (or whatever it's called)
Last edited by Ace-of-Spades (2010-02-14 17:16:18)
Offline
The hulls of the ship would have a weak point (gas tank) (not demonstrated in the diagram) where the laser can enter. The outside outline of the ships could be a certain color and the inside a different color. The outline also reflects internally, and the midpoint of the ship is what needs to be hit by the laser to destroy the ship. There might be a chance that the laser escapes the ship if you have terrible aim. Also there could be a couple of reflecting color lines around the edge that reflect the laser back. If you want, you could also make 2 difficulty settings, with an easy one generating a reflecting color barrier around your ship when the laser fires, and a hard where there's a chance you can be hit by your own laser.
Offline
thanks guys
Offline
Topic closed
Pages: 1