I need to know HOW?

Non-platform specific questions.

I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 9:55 am

In the demo Hblade posted up of the Mario game, I notice bad guys going back and forth on platfroms. How do I do this? Also, I tried to create a Collision event with a cloned actor, and all clones were killed. Like for example, the diamonds in the Cave Man tutorial. Do I have to make and name each diamond individually? Sorry for the noob questions. Any help is appreciated though. Peace.
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby Game A Gogo » Fri May 27, 2011 10:05 am

You're most likely destroying your diamond actor with a collision event.
In that case, you probably put in the name of the diamond actor in the destroy actor action!
Doing so will delete all actors, even clones, to prevent this and only destroy actors he collides with, use "collide actor" instead!
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

Re: I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 10:14 am

OK, yeah thats what I did wrong..thanks for that. Now how do I make an enemy move left to right on a platform? If I can get that I would be happy. Thanks :D !
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 10:31 am

OK, sorry to be a pain. I don't understand what to do. I have my main character, and I am giving him the Collision event/ any side of actor "flying saucer"/ Add Destroy Actor/ "flying saucer". All my cloned saucers disappear when he collides with one of them. I don't see a Collide Actor option. Or am I blind? Don't understand your directions.
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 10:35 am

I've tried putting the collision event on both actors seperately, and got the same result.
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 10:59 am

Never mind I got it. But I still need to know how to make a character move left to right. Not the main character, but an enemy, like the snake in caveman. Thanks. Step by step. I know how to use wire frame to change path, but I cant figure out how to create the character.
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby savvy » Fri May 27, 2011 11:31 am

try using x+= or x-= for movement, and blockers to make the enemy change directions. or you could make it so they move only if their within a certain range of the character:
Code: Select all
if(player.x<x&&player.x>x-200)
{
x-=1;
}

that would make the enemy move left if the player is on its left and within 200 pixels on its left.
Code: Select all
if(player.x>x&&player.x<x+200)
{
x+=1;
}

that would make the enemy move right if the player is on its left and within 200 pixels on its right.
to create an enemy, just clone it. with the collision destroy things, try making them on the enemy's and leaving it as "Event Actor"that way it only destroys the actor whos event it is, so the one which is colliding. create enemys also by using the create actor event and colliders.
have a canvas, then when the player touches it, it makes an enemy say... 300 pixels to the right of it. that way it is made at the right time.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: I need to know HOW?

Postby jcflysrc » Fri May 27, 2011 11:54 am

have a canvas, then when the player touches it, it makes an enemy say... 300 pixels to the right of it. that way it is made at the right time.


This is what I have been trying to do, but I have failed. The actor being created always appears at the collision with the wire frame. I cant control where it is created at. If you could be more specific, that would be nice. Like exactly what steps I need to take, or codes invovlved in making this happen. Thanks.
jcflysrc
 
Posts: 49
Joined: Wed Apr 27, 2011 9:56 am
Score: 0 Give a positive score

Re: I need to know HOW?

Postby savvy » Fri May 27, 2011 1:37 pm

on collision with creator canvas/region ->
Code: Select all
CreateActor("enemy", "animation", "(none)", "(none)", collide.x+300, collide.y, true);

that help?
it makes the enemy 300 pixels along from the creator, and its y point is at the top of the creator...
if you want it to be center of the creator use this:
Code: Select all
CreateActor("enemy", "animation", "(none)", "(none)", collide.x+300, collide.y+(collide.height/2), true);

adds half the height of the creator onto the y value, so centered to the creator.
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: I need to know HOW?

Postby Hblade » Fri May 27, 2011 2:08 pm

What I did was:
I had the character hit the sides of a filled region actor. If collision with left:
Code: Select all
if (animindex!=0) { //if animation is NOT equal to move-right
    ChangeAnimation("Event Actor", "MOVERIGHT", FORWARD); //I forgot the actual change animation code :3
    xvelocity=3;
}

Same with left cept' for the other animation. cloneindex!=1 // change left, etc.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest