Project "UEMIKO"

Making a game with Edward? make a Work In Progress thread here to show it off, and maybe even get some of that feedback thing! (forum is now locked)

Re: Project "UEMIKO"

Postby DarkNemo » Sat Jun 13, 2009 4:24 pm

Ok, first problem.
The game will have 2 or 3 playable characters. It's quite easy to change the graphism of the character by making another "player movie clip" with wpecific graph and animations.
But I don't see how to change player parameters.

For example, if I want :
- character 1 : can jump, can't shoot (pressing SPACE)
- character 2 : can't jump, can shoot (pressing SPACE)
Does anyone see how to make it ? Maybe by changing existing parameters inside a level frame ?

EDIT : Well, I found how to change some parameters like JUMPSTRENGTH and SPEED inside a specific level. Imho, it's "a code trick" that could be really dirty but it works.
I just say "SPEED = xx" inside the level frame.
User avatar
DarkNemo
Player
 
Posts: 19
Joined: Sat May 23, 2009 10:09 pm

Re: Project "UEMIKO"

Postby MakotoNinja » Sat Jun 13, 2009 7:48 pm

If you notice on frame 4 or the "initialization" frame in the actionscript panel nearly at the top you see the static variables used to control the character that are executed on the onGameTick function. Most of these variables are set from the text boxes on the stage and remain constant throughout the game play; they can however, be changed during the game. I would think the easiest way would be to have each character MovieClip contain the values of the parameters you would want to change, so as soon as the character is instantiated on the stage it would change the values for that the onGameTick function is executing.
i.e.
Character 1 Timeline frame 1:
Code: Select all
MovieClip(root).JUMPSTRENGTH = 0;


Character 2 Timeline frame 1:
Code: Select all
MovieClip(root).JUMPSTRENGTH = 15;


I haven't tested this but it should work.
User avatar
MakotoNinja
Player
 
Posts: 28
Joined: Mon Jun 08, 2009 7:53 pm
Location: Kailua Kona, Hawaii

Re: Project "UEMIKO"

Postby DarkNemo » Sat Jun 13, 2009 9:07 pm

Yes !
It works too, and this is a less dirty way to make it work.
Thank you a lot Makoto :)
User avatar
DarkNemo
Player
 
Posts: 19
Joined: Sat May 23, 2009 10:09 pm

Re: Project "UEMIKO"

Postby DarkNemo » Mon Jun 15, 2009 10:50 pm

I created a new item called "Infinite Coins Box" that use infinite collectables, and made animations for the totally useless "Joker Box".
4 - Proto 4 : Adding "Infinite Coins Box" and "Joker Box"
Last edited by DarkNemo on Wed Jun 17, 2009 9:21 pm, edited 1 time in total.
User avatar
DarkNemo
Player
 
Posts: 19
Joined: Sat May 23, 2009 10:09 pm

Re: Project "UEMIKO"

Postby DarkNemo » Wed Jun 17, 2009 9:20 pm

Using part of the code of Makoto, I created an enemy item. This item is really awful, an association of 3 items : fry, animation, and Makoto's baddies.
5 - Proto 5 : Adding enemies, statics and moving ones. Some troubles with moving enemies that never stop.

Well, now I have two problems :
- I dont' really know how to create a smaller collision box (yellow) for the enemy, so I could put it under the mushroom. Resizing the collision box doesn't work, of course.
- I want to make the enemy stop when I kill him by jumping on the animation collision box (purple) but I fail for now.
User avatar
DarkNemo
Player
 
Posts: 19
Joined: Sat May 23, 2009 10:09 pm

Re: Project "UEMIKO"

Postby MakotoNinja » Thu Jun 18, 2009 6:47 am

Firstly, I don't know how much you know, so don't be offended if I explain something you are already aware of. :D
Since you are creating a new symbol type, I would suggest not combining other symbols but rather use the arrays those other symbols use. If you look in the "fryer" movieclip you will see the following:
Code: Select all
(parent as MovieClip).fryArray.push(this);

So every fryer instance that is in the level adds itself to the array and the onGameTick fucntion checks to see if the hero is touching anyone of them; if so, hero dies. So by knowing this. if you want you new bad guy symbol to kill the hero, then you would add it to the same fryer array.
If you noticed in the file I had posted for you, I created a new array to store each instance of the baddies. You will want to do this for your new bad guy symbol as well so you can test between the touching of the bad guys and the hero.
Now you say, this is all fine and dandy; I can jump on top of an enemy, test the collision, and die... great. How do I kill the enemy?
Well I can think of a few ways, some more complicated than others. The easiest I think would be to use the variables already being used in the engine like the "grounded" variable. As far as I can tell, when the hero is either rising or falling the "grounded" variable becomes false. So we could modify the engines "Dangerous Surfaces" loop which is testing for collision against "fryers".
Here is Sophie's original loop:
Code: Select all
//## Dangerous surfaces
   for (i=0; i<mcLevel.fryArray.length; i++){
      if ( mcLevel.fryArray[i].hitTestObject( mcLevel.mcPlayer.collisionBox ) ){
         //mcLevel.mcPlayer.x = safeSpot.x;
         //mcLevel.mcPlayer.y = safeSpot.y;
         xMove = 0;
         yMove = 0;
         grounded = false;
         touchingSlope = "not";
         dying = true
      }
   }

Change the 'if' statement to also test to see if the hero is on the ground:
Code: Select all
if ( mcLevel.fryArray[i].hitTestObject( mcLevel.mcPlayer.collisionBox ) && grounded){

That 'if' statement evaluates 'true' if the hero is on the ground false if the hero is in the air, so we now need to append the the 'if' statement to include and 'else' clause. In here I would call a function that lies in the enemy movieclip that destroys itself, which would include removing that instance from any of the arrays it was stored in like the fryer array and bad guy array, also, if you are using my baddie script to animate the bad guy, you will also have to stop the onEnterFrame function controlling that animation before you remove the clip or you will get errors.
User avatar
MakotoNinja
Player
 
Posts: 28
Joined: Mon Jun 08, 2009 7:53 pm
Location: Kailua Kona, Hawaii

Re: Project "UEMIKO"

Postby DarkNemo » Tue Jun 23, 2009 6:42 am

Makoto made a special baddy, answering to someone else about a jumping-on-head enemy.
Well, it was exactly what I was searching for, so I used this in order to replace mine. (Thank you Makoto for the code hints too :) I'm quite bad in programming so it's very interesting to read your advices).

6 - Proto 6 : Changing the mushroom enemy code and animation (need improvements for die animation)
User avatar
DarkNemo
Player
 
Posts: 19
Joined: Sat May 23, 2009 10:09 pm


Return to Edward WIPs

Who is online

Users browsing this forum: No registered users and 1 guest

cron