I have a good idea for a side scrolling game, but since i'm a bit new to actionscripting and all, I might need help. My idea is a 2d version for the hit Xbox game Halo. I'm just going to do the first level at first, and over the summer when im out of school, i might start adding levels.
These are the scripts I need:
how to make a movie clip rotate without rotating on the X/Y axis
How to swich through guns
Gravity script (jumping)
shooting script
Sheild and health script (sheild regenerates after 5 seconds)
Computer AI script ((for Grunts, ect.) Also, i want them just to walk around intill Master Cheif is spoted)
Vision script
This is just a few scripts, im also looking for Super Metroid Samus Arian sprites, Zero Mission sprites, and Custom Gun/HUD/Enemy Sprites. thanks
I tink a know what you mean. Try doing
this._rotation += #;
and move the sprite (inside its timeline) so that the little "+" sign in the corner is in the middle. (You may have to use "edit multiple frames") and for jumping, try chcking if the "up" key is being pressed and then set a "jumping variable to true. Like this:
onClipEvent(load) {
// sets speed variable
var speed_y = 15;
//sets jumping variable
var jumping = false;
}
onClipEvent(enterFrame) {
// checks if key: "up" is being pressed
// and jumping is false
if (Key.isDown(Key.UP) && !jumping) {
//sets jumping to "true"
jumping = true;
}
//checks if jumping is true
if (jumping == true) {
//moves upward at the rate of "speed_y"
this._y -= speed_y;
// decreases "speed_y" rapidly (for realisticness)
speed_y--;
}
// checks if this hits the "floor" object
if (this.hitTest(_root.floor)) {
// sets jumping back to false (so he stops falling)
jumping = false;
// sets the y speed back to original "15"
// this is so that you don't jump downward next time
speed_y = 15;
}
}
Do you get that all? I hope so.
The speed --- eventually gos into a negative value which brings him downwards. If you need any more help my AIM is freakazoid642 :)
Ok thanks
Originally posted by alzor
lol...dude.. pick up a book and do your programming on weekends, Im 16 I go to highschool and I have less than 2 hours... lose an hour of sleep and start stacking up on crates of that redbull stuff..
High School is nothing... Time there was easy... 8 to 3.. I wish my day ended by 3... My days are 9 to 2 am... :)
lol...dude.. pick up a book and do your programming on weekends, Im 16 I go to highschool and I have less than 2 hours... lose an hour of sleep and start stacking up on crates of that redbull stuff..
[QUOTE]Originally posted by InsaneMonk
if (this.hitTest(_root.floor))
just nitpicking now but _root.floor has to be a rectangular shaped movieclip if you use hitTest like this.
...alright, I'll shut up now
I got a bit confused with the con and tan crap, but my unkle figured it out so im all good. Thanks for all of your help on this. If I can, i'll put all of your names in the game somewere (most likely the end part...)
Now, if someone could please help me on the sprite sheet stuff. I would like a Samus Aran (full armor) Super Metroid or Samus Aran (full armor) Mission Zero, and a custom sprite sheet of the grunts, other eminys, hud, ect. I would appreacate that as well
but a problem with the this._rotation script...
won't it 'flip' a human shaped sprite on it's head?
I mean, every time i use the _rotation = #, it rotates on the slides X&Y, not the sprites X&Y. Like I use...
onClipEvent(load){
on(keypress){
this._x = this._x = 5;
}
_rotation = 0;
}
and it points up, and moves 5 spaces up, but...
onClipEvent(load){
on(keypress){
this._y = this._y - 5;
}
_rotation = 90
}
it moves left 5, but it rotates 90 degrese on the slides x&y (top left corner)
I'm wondering if I can rotate it on the sprites X&Y.
maybe know you understand my drift, hopefully.
and the gravity script i don't get at all. I can't write it down by memory like the _rotation script, but everytime i jump, it goes to the X&Y that i supplied in the AC, but it never comes down.
And everytime i jump after that, it keeps going up and up.
so I need help on that.
thanks
gameskid
About the jumping script...
if you jump onto a higher thing, then jump down, it kinda 'falls' through the bottom of the lower one...
I mean, with the rotating thing, every time I use the _rotataion = #, it rotates on the sceens X,Y coridants, thus, making it ' flip', and I don't have a gravity variable, since i have a 'educational version' version of Flash MX. and the only reasion I'm asking for scripts is because I don't have enough time in a day (which is about two hours with homework) and it would be easier intill the summer where as i have all day.
Originally posted by gameskid
About the jumping script...
if you jump onto a higher thing, then jump down, it kinda 'falls' through the bottom of the lower one...
you need to do hittest with the different objects on the screen to stop it from going into other objects
How to make a movieclip rotate without rotating it. ARE YOU INSANE! You want the contents of the movieclip to rotate through key frames right?
duplicateMovieClip helps for shooting
a gravity variable works for gravity
a timer variable helps for time delays
...what? I'm not going to do all the work.
Originally posted by gameskid
About the jumping script...
if you jump onto a higher thing, then jump down, it kinda 'falls' through the bottom of the lower one...
Check your framerate and make sure ths peed at which you are falling isn't too fast for it to test the rectangle... I'd suggest making the floor rectangle be bigger in size and have it extned down below the actual movie screen that you see... for testing purpose...
KInd-a like this :
http://www.codedaddy.com/files/floor.jpg
The dotted lines represent the screen the player can see... the gray box represents the actual floor... Give it a try...
If not.. then you colission testing is whacked :)
Originally posted by InsaneMonk
The speed --- eventually gos into a negative value which brings him downwards.
like gravity ...
I guess it's my fault since I didn't explain. Oh well.
nb: _rotation is in degrees but Math functions like cos, sin, tan, atan etc all use and return 'radians'. It's mentioned in the flash help [along with a handy way to convert degrees into radians and vice versa]. If I've confused you then I'm sure someone else will be able to explain it to you much better.
emulate (knock on wood)
High School is nothing... Time there was easy... 8 to 3.. I wish my day ended by 3... My days are 9 to 2 am...
for me its more like 6 am to 5 pm, with the commute and everything, but you win any way... LOL, anyway you just prove my point further... if you dont have time you can always make time.
How about... You post your problems, instead of asking for scripts (it seems like that is what you are doing)... And I'll see what I can do to help you :)
You don't have a "gravity variable" because you have an educational version of Flash MX????!??! I don't have a "gravity variable" and I have MX2004 PRO.. (even though I prefer using MX :-/) I don't understand what you want to rotate... do you expect Flash to rotate your sprite for you with the _rotation property??!
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|