Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 4 posts ] 
    Dr. Funk
  Wed Mar 02, 2011 5:38 am
I AM THE RAP GAME
User avatar
Member

I'm in a bit of a pickle getting the mechanics of my game together and I'm in need of some expert help.

All enemies in the game will be made up of 2 objects; the main body, and the arm that holds the weapon. This is because the arm rotates so that the enemy may aim at the player. The problem is, I don't know how to go about making the arm move with the main body.

I know how it would be done if there was only one enemy, but there are several.

The only solution I could come up with is to assign every main body object to an arm object (or vice-versa), and then set it so that the arm's coordinates are always the same as it's "parent" body. I have no idea how this would be accomplished, however.

Any help would be greatly appreciated.


Top Top
Profile      
 

    Amy
  Wed Mar 02, 2011 2:52 pm
User avatar
Staff

Big Dumb Guy
It should be quite simple to just set the one's x and y to the others, I've done this before. I can't remember how, but it was as simple as setting the x and y through D&D commands to something like parent.x and parent.y.


Top Top
Profile      
 

    Dr. Funk
  Wed Mar 02, 2011 11:32 pm
I AM THE RAP GAME
User avatar
Member

that's what I was thinking, but would that work with multiple instances of the same objects?


Top Top
Profile      
 

    Morphex
  Fri Mar 04, 2011 6:44 pm
Member

Create the arm using code, like when the game starts run through all the enemys objects and create a arma instance set to the coordinates of the parent object?

_________________
http://www.morphexe.com/Blog/4009/beta-testing-the-engine-online


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


Who is online

Users browsing this forum: No users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group