Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / How to do a scatter shot effect ?

Author
Message
Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 30th Nov 2009 18:27
I'm trying to make a vertical shooter for my first project.One thing I've noticed about vertical shooters is that the enemies shots aren't aimmed right at you in most cases.They are kind of spread out over a general area in the vicinity of where you are.Do you have any idea how they do that?My code so far only has the bullets flying straight down and I have a pretty good idea on how to get a enemy to fire straight at your current location.But I have no clue how to get a enemy to fire in your general area.Any suggestions?

It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

dark coder
22
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 30th Nov 2009 18:30
Alter the target position by a random amount when firing a bullet?

Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 30th Nov 2009 18:51 Edited at: 30th Nov 2009 18:54
so in essense you would have it like this?


hehe I wonder if something that simple would work?

It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 30th Nov 2009 19:15 Edited at: 30th Nov 2009 19:34
like, get the player's location, get a random number between playerX-20 and playerX+20, and another random number between playerY-20 and playerY+20, and shoot to the random coordinate, you can change that 20 to whatever you want
i hope i got what you meant right lol




alot of syntax errors prolly, but thats just an example, also, using structures and vectors is a good way for making bullets

Ovan35
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location:
Posted: 30th Nov 2009 20:27
excellent thanks both of you..I appreciate the help.If I can get it to work I'll let you guys know.

It was such a small seed... I needed to find out what was growing inside. And there was only one way to find out. So I decided to raise it.

Login to post a reply

Server time is: 2024-11-24 17:25:51
Your offset time is: 2024-11-24 17:25:51