Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

please help and whatnot

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.
 
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.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top