Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #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.


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 06: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 06: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 08: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 02:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.