Newgrounds.com — Everything, By Everyone.

Checking login status…

USERNAME:

PASSWORD:

Logging in…

Logged in as:
.
Logging out…
Inbox My Account Log Out


Forum Topic: Can i have the code for a wall.

(74 views • 10 replies)

This topic is 1 page long.

<< < > >>
Happy

blueblade

Reply To Post Reply & Quote

Posted at: 7/5/08 12:08 PM

blueblade DARK LEVEL 05

Sign-Up: 04/16/08

Posts: 64

Can i have the code for a (hittest) wall. please

there's a lot of assholes on newgrounds. don't join them

BBS Signature

Happy

kylelyk

Reply To Post Reply & Quote

Posted at: 7/5/08 12:09 PM

kylelyk LIGHT LEVEL 09

Sign-Up: 05/15/08

Posts: 243

i need one too.

Even though my questions may be annoying, I believe that I will be able to answer someone elses in the future.

BBS Signature

None

Wolfears2

Reply To Post Reply & Quote

Posted at: 7/5/08 12:09 PM

Wolfears2 EVIL LEVEL 08

Sign-Up: 10/20/07

Posts: 802

No. Learn it yourself.

Click my sig for a hilarious thread.

BBS Signature

None

zrb

Reply To Post Reply & Quote

Posted at: 7/5/08 12:09 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,821

Can i have the code for a (hittest) wall. please

You need to have a wall with the instance name of wall and put this on your player or whatever:

if (this.hitTest(_root.wall)) {
// Stuff that happens
}

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

None

blueblade

Reply To Post Reply & Quote

Posted at: 7/5/08 12:21 PM

blueblade DARK LEVEL 05

Sign-Up: 04/16/08

Posts: 64

onClipEvent{
if( !_root.car_mc.hitTest(_x,_y))
{
this._x+=1;
}
else
{
this._x = _x;
}

how can u fix this?

there's a lot of assholes on newgrounds. don't join them

BBS Signature

None

zrb

Reply To Post Reply & Quote

Posted at: 7/5/08 12:23 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,821

if( !_root.car_mc.hitTest(_x,_y))

That should be:

if (!_root.car_mc.hitTest(_x,_y,true))

Start by fixing that.

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

None

UnknownFury

Reply To Post Reply & Quote

Posted at: 7/5/08 12:26 PM

UnknownFury EVIL LEVEL 21

Sign-Up: 08/10/05

Posts: 5,041

At 7/5/08 12:23 PM, zrb wrote:
if( !_root.car_mc.hitTest(_x,_y))
That should be:

if (!_root.car_mc.hitTest(_x,_y,true))

Start by fixing that.

I think you missed a MUCH bigger error.

onClipEvent{

None

zrb

Reply To Post Reply & Quote

Posted at: 7/5/08 12:28 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,821

I think you missed a MUCH bigger error.

Oh geez I didn't notice that. I'd never think someone could make such an error.
Bluedude, here's your fixed code:

onClipEvent (enterFrame) {
if( !_root.car_mc.hitTest(_x,_y)) {
this._x+=1;
}
else {
this._x = _x;
}
}

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

None

zrb

Reply To Post Reply & Quote

Posted at: 7/5/08 12:33 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,821

if( !_root.car_mc.hitTest(_x,_y)) {

Woops replace that line by:

if (!_root.car_mc.hitTest(_x,_y,true)) {

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

None

UnknownFury

Reply To Post Reply & Quote

Posted at: 7/5/08 12:34 PM

UnknownFury EVIL LEVEL 21

Sign-Up: 08/10/05

Posts: 5,041

At 7/5/08 12:28 PM, zrb wrote: Bluedude, here's your fixed code:

onClipEvent (enterFrame) {
if( !_root.car_mc.hitTest(_x,_y)) {
this._x+=1;
}
else {
this._x = _x;
}
}

LOL. You fucked up what you told him to fix before.

onClipEvent (enterFrame) {
if( !_root.car_mc.hitTest(_x, _y, true)) {
this._x+=1;
}else {
this._x = _x;
}
}

Not quite sure what you're trying to do with this, but thats your code, with appropriate corrections made. Enjoy.


None

zrb

Reply To Post Reply & Quote

Posted at: 7/5/08 12:45 PM

zrb LIGHT LEVEL 09

Sign-Up: 08/08/06

Posts: 3,821

LOL. You fucked up what you told him to fix before.

Which is why I double posted >:D

I can speak french :3 || As :Main || As3: Main || Animation: Main || Flash Tutorials ||

BBS Signature

All times are Eastern Daylight Time (GMT -4) | Current Time: 06:02 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!