Game Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

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, 02:03 PM
Agri Agri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2007
Posts: 114 Agri User rank is Sergeant Major (2000 - 5000 Reputation Level)Agri User rank is Sergeant Major (2000 - 5000 Reputation Level)Agri User rank is Sergeant Major (2000 - 5000 Reputation Level)Agri User rank is Sergeant Major (2000 - 5000 Reputation Level)Agri User rank is Sergeant Major (2000 - 5000 Reputation Level)Agri User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 6 h 1 m 14 sec
Reputation Power: 26
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, 01: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,845 Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level)Viper_SB User rank is Brigadier General (60000 - 70000 Reputation Level) 
Time spent in forums: 1 Month 1 Day 20 h 16 m 27 sec
Reputation Power: 634
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.

Reply With Quote
Reply

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

Developer Shed Advertisers and Affiliates



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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap