Newgrounds.com — Everything, By Everyone.
Age/Gender: n/a, Male
Location: England, Corby
Job: Student
Newgrounds Stats
Whistle Status: Normal
Exp. Points: 210 / 280
Exp. Rank #: 130,524
Voting Pow.: 4.23 votes
BBS Posts: 6 (0.04 per day)
Flash Reviews: 15
Music Reviews: 0
Trophies: 0
Stickers: 0
Entry #2
On My Project With No Name (LOL) I Need Some AC Help :(
I Have Drawn A Up And Down Hill Sloping Ground, My Problem Is When I Make My Character Move Up It He Just Walks Into It, And Then When I Tell Him To Jump, He Appears Ontop Of The Ground He is Inside.
Any Advise // Actionscipt Problems?
My Characters Actionscript Is:
onClipEvent (load) { moveSpeed = 10;}onClipEvent (enterFrame) { if (Key.isDown(Key.RIGHT)) { this._x += moveSpeed; } else if (Key.isDown(Key.UP)) { this._y -= 0; } else if (Key.isDown(Key.DOWN) && !fall) { this._y += 0; } else if (Key.isDown(Key.LEFT)) { this._x -= moveSpeed; }}onClipEvent (enterFrame) { if (Key.isDown(Key.SPACE) && !jumping) { vel_y = 36; jumping = true; } if (jumping == true) { vel_y -= 2; if (vel_y<=-15) { vel_y = -15; } this._y -= vel_y; } if (_root.ground.hitTest(this._x, this._y+35, true)) { vel_y = 0; jumping = false; }}onClipEvent (enterFrame) { this._y += 16; if (_root.ground.hitTest(this._x, this._y+1, true)) { this._y -= 16; }}
And My Ground Simpally Uses A Instance Named ground
Any Suggestions?
Alex
Log in to comment! | Share this!The People Have Spoken
1 Comment