I'm attempting a few things in this project, One is to display a player score, the next is to have a gun powerup for player use, the last is one that I thought I had gotten working, but hadn't. Getting the Esc key to instantly run the game over command, thus exiting the game without showing the player menu.
... so while typing this I figured out the score issue I was having... A winner is me.
The next one is the bigger one. Having a gun powerup that will make it so pressing space bar will fire a projectile that will travel in a straight line in the direction the player was facing when they fired it. That will, when it hits a valid target NPC will run a script to remove said NPC (either with a delete NPC script, or a tag set, haven't decided yet) and increment the score by an amount.
I realize that this is probably a bit tricky. I was trying to use scripts from Space InvadeOHRs, but I'm wondering if I should scrap that and just try to build some from the ground up.
I feel like can achieve this with scripts to create and move slices, though I am a novice with slices. It seems that I could make a script that would be triggered by a key press. Something that would check tags or inventory to see if the powerup is there and has ammo. If so, the script would create either a a walkabout slice of the projectile, or create a rectangle at 2x2 pixels (or something) and remove one unit of ammo. (prob an inventory item)
After the slice is created, it would move until it left the screen or hit a valid target, at which point it would disappear. Could something like this be achieved with the "Move Slice to" command? Perhaps implementing a pixel by pixel, or tile by tile check to see if the slice occupies the same space as the enemy target...
I know this is all very convoluted sounding, and I'm not familiar enough with the scripting commands to probably make much sense. One of the reasons I'm typing these queries out is that it helps me organize my thoughts and clear my thinking. (as I said, while typing I figured out the score issue)
In any case, as always any help (tips, advice, comments, death threats, etc.) would be appreciated. If not, then have a nice night anyway
