2 actors with key down event problem

Game Editor comments and discussion.

2 actors with key down event problem

Postby Hyperyon » Sat Jul 08, 2006 2:16 pm

Both actors have a keydown event so they can move together.
I gave one actor a collision event with an object. Whenever it collides, it stayes behind while the other actor proceeds moving. How can I keep them together? :?
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Postby makslane » Sat Jul 08, 2006 7:31 pm

Why you don't parent the actors?
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Fuzzy » Sat Jul 08, 2006 11:16 pm

instead of moving the actors together with key down events, do that with one actor, and on the draw event set the other actors x and y based on the keydown event actor.
Mortal Enemy of IF....THEN(and Inspector Gadget)

Still ThreeFingerPete to tekdino
User avatar
Fuzzy
 
Posts: 1068
Joined: Thu Mar 03, 2005 9:32 am
Location: Plymostic Programmer
Score: 95 Give a positive score

Postby Hyperyon » Sun Jul 09, 2006 2:19 pm

I parented them :D However, my main goal is to keep them together even when one collides with something. I cant figure it out and worse, I cant continue my game untill I learn how :(
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Postby Game A Gogo » Mon Jul 10, 2006 10:47 pm

put a cilision on the two
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby DilloDude » Tue Jul 11, 2006 1:50 am

What do you want to happen when one collides? Do you want them both to stop?
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Hyperyon » Tue Jul 11, 2006 7:42 am

What do you want to happen when one collides? Do you want them both to stop?


Yes sir!
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Make another Character Follow a Character Code Shown Here:

Postby shadowburn » Thu Jul 13, 2006 3:45 am

Check this or try it at your leisure:


Depending on the size of your graphic character, in this example its 32x32:



Keydown Event = Down
{
y = y + 6; //speed of travel
newactor.y = aminactor.y -32;
newactor.x = aminactor.x;
}

Keydown Event = Up
{
y = y - 6; //speed of travel
newactor.y = aminactor.y +32;
newactor.x = aminactor.x;
}

Keydown Event = Right
{
x = x +6; //speed of travel
newactor.x = aminactor.x - 32;
newactor.y = aminactor.y;
}

Keydown Event = Left
{
x = x -6; //speed of travel
newactor.x = aminactor.x + 32;
newactor.y = aminactor.y;
}




//Cheers, -Jon
shadowburn
 
Posts: 5
Joined: Tue Jul 11, 2006 8:53 pm
Score: 0 Give a positive score

Postby Hyperyon » Thu Jul 13, 2006 1:21 pm

I dont understand what that code will do, all I need is something to stop an actor. I tought of something; when the collide actor collides, i'll disable my main actor's keydown events keeping him absent from movement. However, I need him to move anyplace but past the collision.
Guess i'll also use keydown events for the collide actor so when it moves away from the collision I can enable my main characters keydown events again. I hope it works...
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score

Postby Hyperyon » Fri Jul 14, 2006 3:17 pm

I got what I wanted! Thanks all! I couldnt have nailed it without you! :D
Lets keep our dreams alive!
Hyperyon
 
Posts: 148
Joined: Sat Jun 24, 2006 1:29 pm
Score: 0 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron