Fuze shoot wip
-
So you are using the detectSpriteCollision() function?
You could wait for c.zr and then check for a collision between the crosshair and the target. If the result is negative, thats a miss. -
@Bl4ckM4ch1n3 yeah im using the detectSpriteCollision() function, just not 100% sure how i can code that.
Currently iv bodged 2 offscreen sprites so when i press zr iv setspritespeed to then collide with the other which triggers the miss, if target hit iv done setspritelocation and speed 0 seems to work but bit to messy to track through out the build -
I think you need to change the order a bit. First check for c.zr. If that's pressed check for the spirit collision. If they collide you've got a hit if not you've got a miss. And you don't check for the collision at all if the player isn't firing.
-
@waldron then try the method I've provided in my last post:
@Bl4ckM4ch1n3 said in Fuze shoot wip:
You could wait for c.zr and then check for a collision between the crosshair and the target. If the result is negative, thats a miss.
It's basically the same method as the one that @Richard has mentioned.
The following is not 100% accurate, since I haven't used F4NS in a while. But it should work this way:
if c.zr then for i = 0 to len(targetArray) loop result = detectSpriteCollision(crosshair, targetX) if result == true then thats a hit! else thats a miss! repeat
-
@Bl4ckM4ch1n3 I re-read you post after I'd posted mine and thought I could have just said I agree with you.
-
@Bl4ckM4ch1n3 cheers il have to have another go at it later the button press and collision seem instantaneous il swap round some bits see if i can get a collision order sorted, as a fail safe i could just have a sprite over the screen with roundtime -= 5 and if target hit roundtime += 5 to cancel the miss fire.
seems like such a simple thing to do until you start trying to code it, for me anyway :) -
i could just do away with misfires altogether but would be nice to track players accuracy either way il get it sorted and thankyou for your time
-
@waldron look at my last post again, I've provided some example-code. You can track the accuracy that way too!
Just increase a counter for every shot fired and a second counter for every hit. Then you'll be able to calculate the shot/hit-ratio.
You could even calculate the distance between the center of the crosshair and the center of the target-sprite to give different points:
Like +5 if you hit the center of the target and +1 if you hit it near the border. -
@Bl4ckM4ch1n3 excellent thank you i'l try this,yeah plan on using counters also for score. i like the idea of the extra score on accuracy i could put in the detect code if crosshair.x <= 5 ....
il give it a blast later cheers -
Still not working unfortunately tried all sorts
-
Start with @Bl4ckM4ch1n3 's code, but define a variable before the loop, say countHits.
Then, inside your loop through the targets, add 1 to countHits if the shot hits the target.After the loop, check countHits - if it is zero, you know you have missed all targets.
Is that helpful to try?
-
@DaddyJDM solved now I shared the program and jongjungbu fixed it, just one of those days
-
-
-
Coming along nicely :)
-
Ducks, Dinosaurs and the Dead. What a combo!
-
Still ploughing through this game, I have nearly finished round1 complete with Easter egg and have made good progress on round 2 (a classic boss fight) with changing backgrounds scaling sprites flying towards you . Still lots to do and minor adjustments to make but feeling confident it will get finished and be fun to play .going to try and keep it to 4/5 rounds will see as iv still not got it to where I want it
-
The sprite scaling really adds a lot of polish :)
-
will have a bash at adding an option for motion controls and maybe motion assisted aiming, managed to add in a bonus to the scoring mid-round based on miss/hit targets last night and made a start on player ratings in the form of complements/insults...
-
Before moving on to round 3 just need to add in a bit more information for the player and some other areas of upkeep to take care of, round 3 will be a breeze compared to round 2 i had to rewrite movement code more then i'd like to mention and it still needs tweeking.
The boss fight was going to damage the player but i got rid of that and changed it to score depletion if the missiles reach the edge of the screen so it's just a case of taking out the missiles and blasting the boss in a volley of shots to the head.
The controls atm seem ok i find if i'm tired i hate them but usually i can take out all the targets without a single miss so i think the balance is right if you take the time to practice and get used to the target spawn points.