question on inheritence

Non-platform specific questions.

question on inheritence

Postby Fojam » Fri Jul 20, 2012 8:39 pm

I was making an inherited actor, and i made a create actor event in both of them, but since i made a create actor event in the child actor, it didnt run in the base actor. Do events override each other?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: question on inheritence

Postby skydereign » Fri Jul 20, 2012 8:53 pm

If you have an actor inherit events from another, it will have all events that aren't duplicated. Since the child actor has a create actor, it will only use its own create actor event, even if the base actor has a different one.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: question on inheritence

Postby Fojam » Fri Jul 20, 2012 10:50 pm

okay thanks. also, when you make an object a parent of another object, the child objects actor variables all become the same as the parents, right?
CLICK TO GIVE ME POINTS

My Latest Projects:
Super Smash Bros: viewtopic.php?f=6&t=12307 PLEASE help by making sprites!
User avatar
Fojam
 
Posts: 513
Joined: Thu Mar 19, 2009 10:02 pm
Location: under your bed!!!
Score: 69 Give a positive score

Re: question on inheritence

Postby skydereign » Fri Jul 20, 2012 11:14 pm

Not all of them. The attributes the child adopts from the parent are zdepth, transp, VisibilityState, CollisionState, EventDisable, and the position becomes relative the the parent (and probably a few more). So while real x and y will change as the parent's position changes, the x and y won't change (this is just purely because the relative position doesn't change). But things like the velocity variables aren't shared, nor is angle. Actor variables that you create aren't shared as well. And while zdepth is shared, all actors parented to a specific actor can have different zdepths (but all have the same actual zdepth as the parent).
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest