Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesGame Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2007, 03:03 PM
Agri Agri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 85 Agri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 15 h 59 m 3 sec
Reputation Power: 1
The best way to...

Hey,

I'm making an RPG and would like to know what the best way to change equipment and and alternate between "running and walking" and "sword in sleeve and sword out of sleeve" along with some other movments.

This is what im thinking of right now - I have a model which is a basic animation of a man walking and when the key R is pressed a new model will load with a new animation of the man running. And the same priniples apply to other movements.

Like this -
Controls -

R = Run
W= Walk
A = Arm (draw sword)
D = Dis Arm

Code:
KeyboardState keys = Keyboard.GetState();
if (keys.IsKeyDown(Keys.R))

 myModel = content.Load<Model>( "Run" );
}
elseif { 
(keys.IsKeyDown(Keys.W))

 myModel = content.Load<Model>( "Walk" );
}

elseif {
(keys.IsKeyDown(Keys.A))

 myModel = content.Load<Model>( "Arm" );
}

else {
(keys.IsKeyDown(Keys.D))

 myModel = content.Load<Model>( "DisArm" );
}


Is this good, or is there a better way?

Reply With Quote
  #2  
Old December 12th, 2007, 02:00 AM
Viper_SB's Avatar
Viper_SB Viper_SB is offline
Psycho Canadian
Dev Shed Demi-God (4500 - 4999 posts)
 
Join Date: Jan 2001
Location: Canada
Posts: 4,795 Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Viper_SB User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 4 Weeks 23 h 51 m 32 sec
Reputation Power: 437
Does it work? If so then ya it's fine , IMO the best way is to build most of it first then do refining after, as you build you'll find if something works well or not.
__________________
Miscellaneous Software
Viper_SB
Developershed E-Support


Anyone else play chess?
Challenge me

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesGame Development > The best way to...


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT