The Daily Click ::. Forums ::. Klik Coding Help ::. shotgun
 

Post Reply  Post Oekaki 
 

Posted By Message

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th June, 2004 at 10:36:32 -

...rgiht, I know this is a noobish question, but I really want to know how to do a shutgun with a top view game. More precise, the player looks towards mouse pointer, I want to shoot 5 bullets in more or less random direction towards the mouse.

 
http://www.robocaptain.com

Shen

Possibly Insane

Registered
  14/05/2002
Points
  3497
27th June, 2004 at 11:51:37 -

http://www.create-games.com/article.asp?id=1322

What's a shutgun?

 
gone fishin'

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th June, 2004 at 13:33:15 -

yea well, the article wasnt any usefull. It showed how I should do it when I have I have 360 movemets, and I dont have that. So, what should I do?

Image Edited by the Author.

 
http://www.robocaptain.com

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
27th June, 2004 at 13:48:07 -

You've got a few choices here. You can make 5 different bullet objects, each one should have a couple frames of animation, now off set them with the hotspot, meaning make the bullet appear to move to the left or the right by setting the hotspot off one or two from the previous frame. Now, make sure you loop the last frame of animation, otherwise the bullets will move really strangly. Rotate the bullets (the handy little circular arrow rotate button) For your firing command, just use a shoot at command. Make a couple of these and you get a kind of shot gun effect.

 
Craps, I'm an old man!

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
27th June, 2004 at 16:08:19 -

hum ya, interesting. Is there another way to do it, maybe with some coding?

 
http://www.robocaptain.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
27th June, 2004 at 16:55:50 -

I shall bury my head in the sand and ignore all the TGF users, 'cause it's hard to make a decent movement with it. But you can't really make a shotgun unless you use 360 degree movement - I mean, the pellets don't spread out as much as two TGF directions :/

 
n/a

Knudde (Shab)

Administrator
Crazy?

Registered
  31/01/2003
Points
  5125

Has Donated, Thank You!Clickzine StaffKlikCast StarVIP MemberGhostbuster!Dos Rules!I donated an open source project
27th June, 2004 at 17:01:09 -

I have a much more complicated way of doing it, but my code is at home. I'll throw up a little example and post it here later, you will need fastloops though.

 
Craps, I'm an old man!

David Newton (DavidN)

Invisible

Registered
  27/10/2002
Points
  8322

Honored Admin Alumnus
27th June, 2004 at 17:56:12 -

Very quick fix for this: Create five of your "bullet" objects and set their directions to Dir("Player") + ((random(5) - 2)). That should randomise the bullet spread between -2 and +2 directions away from where the player is facing.

That does use TGF directions, though, which as said above may be a little too spread out.

 
http://www.davidn.co.nr - Games, music, living in America

Muggus

Possibly Insane

Registered
  31/07/2002
Points
  2958
28th June, 2004 at 01:22:28 -

If your using a 360 degree bullet engine then you've got alot of choices on how to do it.

This is pretty much assuming that you've already set up 360 degree projectile movement for your shotgun pellets.

- Player pressed fire button
Run "Shotgun" FastLoop 5 times

- "Shotgun" loops is running
Create Pellet 0,0 at Players action spot...or wherever
Set Value A of Pellet to (360 degree conversion of where players aiming) + 10 - random(21)
Set X of Pellet to X("Pellet") + 3 - random(7)
Set Y of Pellet to Y("Pellet") + 3 - random(7)

This is assuming a few things.
Firstly, you have a value in 360 degrees for the direction your player is aiming.
Secondly, that Value A of Pellet is the direction in degrees.
And that you have the whole 360 degree engine setup.

Basically you can play around with the numbers here. I've made the pellets have a random inaccuracy of + or - 10 degrees off where the player is aiming. And an initial spread of + or - 3 pixels from where the pellets were originally created.

I could make an example if you don't fully understand.

 
MUGGUS
Come and annoy me more at
www.muggus69.tk
STOUT ANGER!!!

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
4th July, 2004 at 11:49:26 -

So, what should I do. I dont have a 360 engin, and I dont want it. I tried Wong`s example, and it was a little to spread out - as he said him self. So what should I do If I have MMF and want to do 5 shotgun bullets shoting towards an object?

 
http://www.robocaptain.com

ChrisB

Crazy?

Registered
  16/08/2002
Points
  5457
4th July, 2004 at 14:22:16 -

You use a 360 degree engine or you have spread out bullets :|

 
n/a

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
4th July, 2004 at 16:52:53 -

that is stupid, there must be a way! shotgun stuff is easy.

 
http://www.robocaptain.com

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
4th July, 2004 at 18:08:56 -

maybe I will!

 
http://www.robocaptain.com

Yuhkaz

Sin Binned (Broke The Rules)

Registered
  30/09/2002
Points
  -100
6th July, 2004 at 12:11:38 -

lol

It's easy even if you don't have 360 -movement-, you can still have the shotgun pellets use some of the directions. Its so damn simple... play around.

 
n/a
   

Post Reply



 



Advertisement

Worth A Click