parents and movement

Game Editor comments and discussion.

parents and movement

Postby thunderios » Mon Mar 17, 2008 2:01 pm

When I was creating a soccer-game I made the ball the child of the player. There was an enemy chasing me, but when he came to the point I catched the ball, he stood still.
So I think when you parent something, the child does not change his x/y positions. It took me some time to find that out so I wanted to share that with the world :)

Maybe this should be changed in the feature, but it's no neccesary as long as you know what happens...
thunderios
 
Posts: 87
Joined: Thu Jan 31, 2008 1:18 pm
Score: 1 Give a positive score

Re: parents and movement

Postby Caaz Games » Mon Mar 17, 2008 2:24 pm

the parenting makes it so when the parent moves the child moves with it and the child would have the same tranceparency and z depth
You are welcome to join my forum. 4 active members lol but it's a cool place. active... much talking :D it's fun!
http://caaz.freeforums.org/
User avatar
Caaz Games
 
Posts: 729
Joined: Wed Feb 14, 2007 9:09 am
Location: California....knows how to party!
Score: 25 Give a positive score

Re: parents and movement

Postby DilloDude » Tue Mar 18, 2008 1:17 am

The x and y coordinates are relative to the actor's parent. (If there's no parent, than it's relative to the game centre) So if you want to calculate distance/direction etc. try using xscreen and yscreen instead (as they are always relative to the same location for any actor).
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron