You are not logged in.
Announcement
#26 01/08/08 3:22am
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Game Maker isn't compatible with PSP.....sorry dude!
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#27 01/08/08 3:35am
Re: Basic LiveSwif Classes
i know! i just excited! i did a test and made a hard little game where you had to click little balls to get points and they were all quick like lol and bouncing everyware and i got to make sprite strips which i need help with walking animations and othe movement animations!!!!?!!
[b]OBEY[/b]
MINECRAFT. Hit me up if you wanna play [:
Offline
#28 11/08/08 5:34pm
- marclapatate
- Regular Member
- Registered: 23/07/08
- Posts: 70
Re: Basic LiveSwif Classes
i trie but i dot now who more can you put a video who to do what you want to teach i am noob in flash game thx
[img]http://img183.imageshack.us/img183/3103/ppwa8.png[/img]
Offline
#29 15/08/08 11:07am
#30 15/08/08 3:10pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
No, it has to go that way. I don't know why. _y -= 10; for UP.
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#31 15/08/08 4:29pm
Re: Basic LiveSwif Classes
oh you should check my game out http://www.pspflashgaming.com/forum/vie … hp?id=1332
[img]http://i42.tinypic.com/5vd3cy.png[/img]
Offline
#32 16/08/08 4:21pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
nothing's Classroom- Moving Characters
===========================================
Alright, this tutorial is about MOVING SPRITES and MOVING CHARACTERS.
In order to move characters, you need multiple images. Look here. Do you see how there are mulitple images to one animation? For example, if mario here is running, we take ALL the frames of that animation,put it together, and mario looks like he's running. Right? YEs. Now to pu that in your game, there are a few small changes to make, and a basic layout of your main character.
1) Make a new sprite.
2) On frame 1 of the sprite, put Mario's Static image (the one where he is just standing). We only need the one where he is facing the right.
3) On frames 2- whatever, put the animation for him running.
4) On the frame after the running animation, out his jump image. Only the one facing the right.
[center]Warning! ActionScript ahead![/center]
5) On frame one, put a stop command (stop(); if you don't remember from class one.)
6) On the last frame of your run animation use a "gotoAndPlay();" command on the frame and put 2 within the parentheses ("gotoAndPlay(2)").
7) On the frame with the jump image, put a stop command.
Alright, now that our character has been set up, lets go to his movement code:
Code:
on the enterFrame syntax: ++gravity; _y += gravity; if (Key.isDown(Key.RIGHT)) { this._xscale = 100; gotoAndPlay(4); _x += 10; } else if (Key.isDown(Key.LEFT)) { this._xscale = -100; gotoAndPlay(4); _x -= 10; } if(this.hitTest(_root.ground)){ isJump = false; gravity = 0; --_y;
Let's take a look at this code:
Line 1 asks flash if the Left key is pressed.
Line 2 tells flash that now that the key is pressed, this thing's facing Left (Because we flipped around the other way with the_xscale. _xscale is a property of the image, which basicvally means a trait. If your friend is facing right, his _xscale is 100.)
Line 3 tells flash to move the image to the left by 10 pixels.
Line 4 tells flash to put this image on the sprite's frame 2, which is the run animation.
The same for the one on right. Now for the onMouseDown:
Code:
Switch one thing out for the jump code: if(!isJump){ gotoAndPlay(frame withthe jump animation) jump code here }
That's all!
Last edited by nothing (16/08/08 4:51pm)
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#33 16/08/08 4:52pm
#34 16/08/08 4:55pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Here's what it should look like:
http://www.resiststorage.org/images/ChangerTest928.swf
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#35 16/08/08 4:57pm
#36 16/08/08 5:03pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Really? It should...
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#37 16/08/08 5:10pm
#38 16/08/08 5:12pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Does it work?
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#39 16/08/08 5:19pm
#40 16/08/08 5:30pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
ok.
nothing's Classroom
================================
Today, I will teach you about boundaries. These are very simple, and you SHOULD be able to underdstand them by looking at the code, Nevertheless, I will explain it line by line.
Code:
enterFrame: if(this._y>272){ this._y += speed; } if(this._y<0){ this._y -= speed; } if(this._x>480){ this._x -= speed; } if(this._x<0){ this._x += speed; }
Now, replace speed with your speed for the character. Now guess how this works.
ding! Times up! It's actually pretty english. If this thing's y coordinates are higher than 272 pixels, push it back down at the same speed it came in as, and the same so on.
That's all!
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#41 16/08/08 5:53pm
#42 16/08/08 6:01pm
- sfc2000
- PSP-RATOR <(@..@)>
- Registered: 24/03/07
- Posts: 1830
Re: Basic LiveSwif Classes
nothing wrote:
Here's what it should look like:
http://www.resiststorage.org/images/ChangerTest928.swf
Its-a-me mario
are you making a mario game as well
Offline
#43 16/08/08 6:03pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Maybe...
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#44 16/08/08 6:06pm
- sfc2000
- PSP-RATOR <(@..@)>
- Registered: 24/03/07
- Posts: 1830
Re: Basic LiveSwif Classes
really you must be doing tons of flash projects
Offline
#45 16/08/08 6:11pm
#46 16/08/08 6:22pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
Lol, it' not that hard.
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#47 16/08/08 6:36pm
#48 16/08/08 8:33pm
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
I haz teh time
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#49 17/08/08 5:01am
- nothing
- Moderator
- Registered: 21/03/08
- Posts: 389
Re: Basic LiveSwif Classes
nothing's Classroom Better Ground and platforms
==========================================
Ever notice that when you jump on a platform with my previous jump codes, you usually fall through just a little? Yeah, you know why?
Guess:
Code:
isJump = false; gravity = 0; --_y;
It's because of that third line. It says to decrease the _y value. Therefore, it pulls it down. But if you put ++_y, it increases pushing it up. Now what?
Set the player's _y to the same as the platform's of course! But how? With a little OOP. Don't run away now, trust me you have done this before. I will hold your hand ALL the way through it.
OOP just stands for Object Oriented Programming. Basically that means giving something a name and telling it what to do by calling it by it's name. Simple.
SO platform1's instance name (Your OOP name...) is "platform1".
So guess what you write:
Code:
if(this.hitTest(_root.platform1)){//This WHOLE line is OOP. You have done it before. isJump = true; gravity = 0; this._y = _root.platform1._y; }
Once again, pretty straight forward. Try it. It's perfect.
[url=http://pspflashgaming.com/forum/viewtopic.php?id=1078]BioShock[/url] PSP|fPS-Factor Released|[url=http://www.p22server.hostwq.net/index.html]p22 Center[/url]
I'm starting p22 again.
Offline
#50 17/08/08 6:08am
- crimsonhotsun
- Hardcore Member
- Registered: 30/03/08
- Posts: 96
Re: Basic LiveSwif Classes
I see as you're writing this tutorial you're learning quite a bit .
I think though that this is a good analogy for OOP.
Think of a variable or function as a stick. You can hit people with it, that's about it. Now think of an object as a tree. It bears fruit, leaves, and more sticks for hitting people.
platform1 is a movie clip. When you put that on the stage, it's like planting a tree. Platform1 has many different values all inside of it-fruits, leaves- unlike a single variable that is only a stick.
[img]http://img101.imageshack.us/img101/9094/20707804nc6.png[/img]
My humble forums: [url=http://hologram.zxq.net/forums/]VirtualWorldForums[/url]
Offline