123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|619|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Shooting in the direction of the mouse

Wed, 27 Jun 2007, 11:34
mole
Basically, there is a "bunker" in the middle of the screen and it shoots bullets when you click. The bullets go off in the direction of the mouse - so if you click towards the left of the bunker, the bullet will shoot out left [towards the mouse] etc etc.

This game is, well, very similar to this: bunker

Also, I will inevitably run into more maths related problems in making the enemies come from all different directions straight into the bunker.

I do not think it is necessary for me to post my code... it doesn't actually do anything (hence my asking here )

Any pseudo code, built-in functions, anything angle related will be most appreciated

ta
Wed, 27 Jun 2007, 13:23
Erebel55
Here is some code that you might find useful, I'm sure I have a lot more stuff that would be useful to you but it's hard sifting through all of my old blitz code. I do not take credit for this code because I can't remember if I wrote it. Well I hope it helps, good luck.



-=-=-
Lava Monkey
https://play.google.com/store/apps/details?id=com.lvm.lavamonkey
Wed, 27 Jun 2007, 13:23
Dabz
You need ATan2:-



Works a charm!

maDenathorn
---
lol, posted at exactly the same time... whats the chances!

maDenathorn

-=-=-
Intel Core i5 6400 2.7GHz, NVIDIA GeForce GTX 1070 (8GB), 8Gig DDR4 RAM, 256GB SSD, 1TB HDD, Windows 10 64bit
Wed, 27 Jun 2007, 14:50
mole
Wow, those are two really great examples!

Thanks a lot ^^
Wed, 27 Jun 2007, 23:17
magicman
you said you need ATan2, so i just had to do it without using ATan2! Its probably a little over complicated, but it works!



-=-=-
Stuff... Yeah...