00:00
00:00
Newgrounds Background Image Theme

fillup69 just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As:extreme Basic 3d

1,099 Views | 9 Replies
New Topic Respond to this Topic

As:extreme Basic 3d 2005-10-24 09:47:57


Welcome to the Easy and Basic 3D tutorial.This somewhat 3d type game still has me pondering because I know it isn't completed with boundaries or anything yet.Let's begin.

What is used in this tutorial

_xscale
_yscale
Key.isDown
Keycode
Flash Camera(find it on Newgrounds)
Variables

Coded Boundary

You need to draw out your background place.This is pretty much the part that makes this 3d.

Orange and Black Game Collab Engine(currently in edit)

This engine is still being bugged out as you may see.

Movement Keys

w-forward
s-backward
a-left
d-right

Make sure your background looks somehwhat similar to that using point perspective.

The coding part requires you to have a Flash camera.The code will be placed inside the camera.You can find it somewhere off Newgrounds I'm guessing.(Flash Camera requires Flash 7)

First of all,add your variables.I mean variable.The rest of the variable use areas need to be changed individually.

onClipEvent (load) {
speed = 3;
}

Pretty simple,eh?Ok,next,add your first bit of real code.

onClipEvent (enterFrame) {
if (Key.isDown(83)) {
this._xscale += 2;
this._yscale += 2;
}

onClipEvent-Sets the event to happen,in this case,enterFrame
if-The 'if' of the code to set what happens(when there's an 'if',then there is a 'then')
Key.isDown-Setting the type of 'if'
(83))-Usually there would be something like (Key.UP)) here.I decided since the mouse and keyboard is used in my game that I would use Letter Keys.83 in keycodes is S.I'll list the keycodes later in the tutorial,or you can find them in the main tutorial section.
this.-This lets Flash know that we're talking about 'this' MovieClip,the Camera.
_xscale-Similar to _width.If you move all the way forward in my game,you'll end up flipping everything.It's wierd.
_yscale-Similar to _height.This helps in the move all the way forward
_x-stands for left/right in movement,or in this case,for width/_xscale.
_y-stands for up/down in movement,or in this case,for height/_yscale.
+=2;-adds how much width/height to the MovieClip as selected.
-=2;-subtracts how much width/height to the MovieClip as selected.

This goes for the next part of the code...

if (Key.isDown(87)) {
this._xscale -= 2;
this._yscale -= 2;
}

Notice how the 'if' is continued.Keep it that way.87 stands for W.

This next code is to move your Camera left or right.

if (Key.isDown(6) {
this._x += speed;
}

68 stands for D.

...and...

if (Key.isDown(65)) {
this._x -= speed;
}

65 stands for A.

Now I'll get into some boundaries.

if (this._x>550) {
this._x = 550;
}

This code is a basic AS boundary.

_x>550-and easier way to understand this is saying "If this object's _x is 550..."
_x=550-this continues the last sentence "...then the object's _x should be 550(still)"

Here are the AS Keycodes that I promised...

65=A
66=B
67=C
68=D
69=E
70=F
71=G
72=H
73=I
74=J
75=K
76=L
77=M
78=N
79=O
80=P
81=Q
82=R
83=S
84=T
85=U
86=V
87=W
88=X
89=Y
90=Z

These boundary codes keep your Camera from exiting the area left from right or up from down.The problem is that I haven't gotten one of my boundary codes for the _y value to work yet.Also,I still have to edit my camera to get my aimer to keep it's size.So...that's it for basic 3D moving.

BASICBASICBASICBASICBASIC Even more basic then delta_luca's I bet.

wat

Response to As:extreme Basic 3d 2005-10-24 10:04:46


meh, its not really 3D. It is kinda cheap 3D. All you're doing is stretching a MC. It doesnt look good.
But you explained what you were doing well.

Response to As:extreme Basic 3d 2005-10-24 10:06:30


At 10/24/05 10:04 AM, Glaiel_Gamer wrote: meh, its not really 3D. It is kinda cheap 3D. All you're doing is stretching a MC. It doesnt look good.
But you explained what you were doing well.

Yah well I've never done anything like this until last night.I could try delta_luca's tutorial for basic 3d,but I'm not sure he's posted anything on this kind of 3d.


wat

Response to As:extreme Basic 3d 2005-10-24 10:06:35


Thats not basic 3d because its not 3d at all.

Response to As:extreme Basic 3d 2005-10-24 10:15:00


It's somewhat 3D if you use your imagination(Move side to side,it seems like you turn your head when actually the camera is just moving.)

Originally it would look like you were falling...


wat

Response to As:extreme Basic 3d 2005-10-24 10:28:22


Is there anyway to skew things in AS?


BBS Signature

Response to As:extreme Basic 3d 2005-10-24 10:41:29


You, yourself, said your 3D sucks, then why post a 3D thread?
It's actually a _xscale and _yscale thread.
Meh, it wasn't really good =/


BBS Signature

Response to As:extreme Basic 3d 2005-10-24 10:43:54


At 10/24/05 10:41 AM, -Toast- wrote: You, yourself, said your 3D sucks, then why post a 3D thread?
It's actually a _xscale and _yscale thread.
Meh, it wasn't really good =/

I remember when you posted basically the same tutorial.

Zooming and panning is not in any sense 3d, and no one really needs a tutorial on it either.

Response to As:extreme Basic 3d 2005-10-24 10:44:57


What are you talking about? I never posted any 3D tutorial...


BBS Signature

Response to As:extreme Basic 3d 2005-10-24 10:58:19


At 10/24/05 09:47 AM, -Thomas- wrote:
Even more basic then delta_luca's I bet.

Haha, nice joke... Delta luca's is about 999 times less basic than this...


BBS Signature