Page 1 of 2

Levels

PostPosted: Mon Feb 20, 2006 6:14 pm
by The achievement
Hi guys I was wondering how i make levels in the game not just one huge game. Can sombody help me on that? Would be appreciated!!!!

PostPosted: Tue Feb 21, 2006 8:43 am
by Troodon
It depends do you want level to change with time or with actor placement. There are many ways to change levels, I make it with a goal actor wich transports the main actor to the 2nd level when collision.

PostPosted: Wed Feb 22, 2006 7:42 pm
by The achievement
So i make a collision to a wall with my main character that walks,jumps,etc. i dont get what you mean, is there a code for this or event,collision,then script editor?? Give me some ideas, would be much appreciated!!!! I mean if you would like to!! :D

PostPosted: Thu Feb 23, 2006 7:46 am
by Troodon
Make a goal actor. (for example a flag where is written "Level complete")
When the main actor collides with the goal actor it is tranported to another place.

main actor
->collision (any side of goalActor)
->script editor
Code: Select all
x = 2588;
y = -2100; //this x and y coordinates tell where the actor will be after collision.


I hope this helped. If not, keep asking! :D

PostPosted: Sun Feb 26, 2006 5:25 pm
by The achievement
ok i see what you mean but i still didnt do it yet but i will try, but i think i am on the same path as you, ok so you are telling me when i hit like a diamond (anything that goes up for a score)at the end of the level i can transport? I think thats it.. :?

PostPosted: Sun Feb 26, 2006 8:26 pm
by The achievement
Tekdino i think it worked but when i hit the Flag, my main actor just disappeared?? Is that supposed to happen????

PostPosted: Mon Feb 27, 2006 12:57 am
by DilloDude
Make sure the view is moved with the character as well.

PostPosted: Mon Feb 27, 2006 1:00 am
by The achievement
Um......... What? View is that where you see the character while your and it moves when ur character moves? Please explain more clearly. Sorry i coudnt get what you mean!

PostPosted: Mon Feb 27, 2006 7:09 am
by Fuzzy
tekdino wrote:
Code: Select all
x = 2588;
y = -2100; //this x and y coordinates tell where the actor will be after collision.



You can also do this: make a flag actor and also a destination actor. Then you just borrow the destination actors x and y. This might seem like extra work, but then you can move around the destination without having to fiddle with the teleporter actors(if you have several of them).

Code: Select all
x = NextLevelStart.x;
y = NextLevelStart.x;


You could also use a lookup table. If your game has stages within a level and save points along them, you just have a player variable that records the stage number. This is then used to look up two values from array.

you'd put this in the collision between the player and the save point actor.
Code: Select all
Player.savepoint=Player.savepoint+1;
CollisionState("Event Actor", DISABLE);


and then when the player dies...
Code: Select all
Player.x = Xarray[Player.savepoint];
Player.y = Yarray[Player.savepoint];


So you can see, its possibly more complicated, but its also more versatile. In the case of save points, each save point could be a clone; you wouldnt need to modify any of them. It would make it a snap to add an extra in if you thought you'd need it.

PostPosted: Mon Feb 27, 2006 9:02 pm
by The achievement
Hi pete! ok so i make a flag or an object that lets me teleport right? then i do x = 2588; for where you go to teleport to. Then after that i make a desination actor and then put this code y = -2100; then i just go to level 2 right? :?

PostPosted: Mon Feb 27, 2006 10:04 pm
by Kodo
I too use filled regions to mark destinations when moving the view around,, it makes it soooo easy and you dont have to worry about coordinates :)

[on level complete]
view.x = destination_filledregion_name.x;
view.y = destination_filledregion_name.y;

PostPosted: Mon Feb 27, 2006 10:26 pm
by The achievement
ok on my level complete i have a flag, Is that ok? or do i need a Filled region to do this code? Also, when i do this code(if i can) on the flag so i go to draw actor,script editor? im confused Im sorry for asking so many questions! No really i am sorry! I am taking all your time away and you guys are being so nice but im confused :?

PostPosted: Mon Feb 27, 2006 11:14 pm
by Kodo
yeah, it doesnt have to be a filled region, it can be any actor you like. I just use filled regions because they dont require an animation/image, look tidy in the editor and the x and y positions are clear ( x:0 and y:0 are in the top left corner of the box)

PostPosted: Tue Feb 28, 2006 12:54 am
by The achievement
ya but for odd reason when i hit the flag, my main actor just disappears somewhere. What is up with that??

PostPosted: Tue Feb 28, 2006 10:10 am
by DilloDude
Is the player actor the parent of the view?
If not, when the player collides with flag, have
Code: Select all
x=filledregion.x;
y=filledregion.y;
view.x=filledregion.x-200//The center of the view actor is the top-left corner-use half the view's width instead of 200
view.y==filledregion.y-100//see above

Otherwise, the player collides with the flag and moves to the filled region's location, but the view dosen't and you will just see th player disappearing.