 and welcome everybody to Vectrec Tech demo number two. So this is my Vector Graphics Star Trek game I've been kind of working on and let's take a look. Sorry, I'm not at home right now so I don't have my proper equipment so you have some weird effects like that going on. Anywho, a quick shout out to my snake snakes. Kevin and Paul who have been members of the channel for one month or more. And my invader shout outs, Yan, Mode, Kim, Xiong and Finesz who have been members, they've joined this past month. Thank you so much for supporting the channel. So Vectrec is an idea that I cooked up with Kevin. Kevin's a big Star Trek fan as am I. Hopefully you caught the first demo and this is the second demo where I've added phasers and at least nicer phasers and I've added damage and I've added basically the enemies can fire back but they don't aim very well. So let's take a look at what we've got here. So you see here I've got 10 enemy starships. These are gonna be Klingons, I guess. I don't know if that's a copyright thing. Sorry, Star Trek people. Anyway, you can see that the enemies are firing kind of randomly. So what happens is a random enemy will fire. Doesn't have to be aiming at me. It only will choose someone that is close to me. I chose 200 pixels. Now my starship can fly around. I can shoot back, which is nice. Now you see how things are moving a little bit slowly. Partly that's the turtle graphics and partly that is because I'm recording the screen. It does run a little faster when I'm not doing that. So I can shoot but the thing that really actually took me time was to add phasers and so I added phasers with the left shift key and so you can see the phaser effect there and I can see I just destroyed that enemy. What it will do is it will find the closest enemy and shoot at them. So when an enemy is destroyed or as I move it will choose a different enemy that is closer. Maybe later I can add aiming but I think this is a pretty cool effect. You can see it speeds up a little bit because there's less drawing and then ideally what I like to have happen is it kind of flies off the screen and is happy or we'll figure something out with that. But anyway, that is what I added today. The code is not that pretty. This is a demo and this is one of those things I think it's good for people to see this process. I didn't know how to do certain things and I'm just kind of throwing the code in. I'm not worried about making it pretty. You may have noticed I made the screen size a little bit bigger, 1,200 by 800 instead of 800 by 600. And basically what I've done is I've added, let's see what did I add? That's a good question. Okay, actually I see. To my vector class I added phaser power, photon torpedoes and shields. Don't do much of that yet except for the shields. That's how we know when one of the enemies is dead when their shields drop to zero or less. And let's see here the starship. I don't know what I did to that. I added a fire phaser method, which actually fires the phaser and like I said earlier, just a copy of what I had in the first video where I looked through all the vectors and I tried to find the closest enemy. And then if that closest enemy is a target, then I fire a phaser and I'm assuming that I'm gonna hit the enemy so their shields go down by minus 10. Photon torpedo hasn't changed enemy. I don't think it's changed much either. Ah, the shield thing. If your shields are less than or equal to zero, you destroy yourself. What that means is you are no longer active and it moves you off the screen. You notice also here I created an actual phaser class. Don't know if this is the right idea, but it seems to be working. And so each phaser fires from one vector at another vector and I have a little timer that's 10 frames. And so that phaser will render for 10 frames of the game. And it's just a red line I draw. Now I can, I'll probably change it later. So the player's phasers are one color while the enemy's phasers are a different color. So we can kind of identify who's firing whom and what all kinds of game logic at that point. And then you can see here, I just made a phaser, I have a phaser class, so I need a phaser object. I think that's about it. Oh, I have a fire phaser method, a fire photon method. You know, changed a few things. The code will be in the link down below. Check it out. Again, this is a demonstration, not a tutorial, but yeah, you can see here, here's the code to fire the enemy torpedo. And if the torpedo is not active, means it's ready to be fired, choose a random vector. You know, check the distance, blah, blah, blah, et cetera, et cetera. Let's take one last final look at that. And so I have 10 enemies on the screen. Shoot, and shoot, and it disappears. Left shift, and you can see the phasers are very powerful. Now this makes the starship way too powerful. What we'll do later is we'll add some kind of, you know, phaser power thing. So when you shoot, you lose power. And if you have zero power, you have to wait for the shields to build back up or something like that to make it a bit more competitive. Plus we'll have the enemies firing back and plus I wanna have shields being rendered as well. So there's quite a few things to go. This is in the very early stages, but it's been fun to do. So thanks to Kevin for suggesting it. Thanks to everybody who watches and supports the channel. Check out the links below for more information on supporting the channel. Have a good one. Thanks, that's sorry about all this.