Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6
This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 28th, 2009, 02:27 PM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default XNA Shooter help

Hey,
I'm interested in adding leveled weapons to XNA shooter. As in, picking up one rocket item will give one rocket per shot, a second one would give two rockets per shot, you get the idea. Heres the code I have so far:
Code:
                    else if (itemType == ItemTypes.Rockets)
                            if (Player.currentWeapon == Player.WeaponTypes.Rockets)
                            Player.currentWeapon = Player.WeaponTypes.UberRockets;
                            else Player.currentWeapon = Player.WeaponTypes.Rockets;
And then the code for the weapon UberRockets will double the shots by creating a second rocket firing at the opposite altnerating point here:
Code:
                    case WeaponTypes.UberRockets:
                        if (gameTimeMs - lastShootTimeMs >= 850)
                        {
                            Vector3 shootPos = shipPos +
                                new Vector3(shootNum % 2 == 0 ? -2.64f : +2.64f, 0, 0);
                            Vector3 shootPos2 = shipPos +
                                new Vector3(shootNum % 2 == 0 ? +2.64f : -2.64f, 0, 0);
                            Mission.AddWeaponProjectile(
                                Projectile.WeaponTypes.Rocket, shootPos, true);
                            EffectManager.AddFireFlash(shootPos);
                            Mission.AddWeaponProjectile(
                                Projectile.WeaponTypes.Rocket, shootPos2, true);
                            EffectManager.AddFireFlash(shootPos2);
                            EffectManager.PlaySoundEffect(
                                EffectManager.EffectSoundType.RocketShoot);
                            shootNum++;
                            lastShootTimeMs = gameTimeMs;
                            Input.GamePadRumble(0.40f, 0.75f);
                            Player.score += 0;
                        } // if
                        break;
Am I missing anything? Also, is it possible to angle the camera instead of having it top down, sort of like an angled chase cam? If anyone can help me out with this I'd be very grateful, thank you.
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using XNA 2.0 ibeanewbie BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 January 25th, 2008 06:55 PM
XNA shooter problem alexmbr BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 0 August 10th, 2007 07:26 PM
XNA Shooter - Black Screen DMP_HERE BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 4 August 5th, 2007 07:04 AM
Chapter 11: XNA Shooter - black screen IanBrooks BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 3 August 4th, 2007 09:32 AM
XNA Shooter not working... savagesoft BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 7 May 11th, 2007 03:26 AM



All times are GMT -4. The time now is 08:59 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.