Fixed:
Make a ball (mc) and the lines (mc)
and give the ball this code:
onClipEvent(load){
if(key.isDown(key.RIGHT){
_x.this ++
}
if(key.isDown(key.LEFT){
_x.this --
}
if(this.hitTest("lines")){
_y.this ++
}
}
lines code:
onClipEvent(load){
_y.this ++
}
//that should be everything. HTH
Hahaha, lawlz what?
you mean, and put this on the root, not the ball:
ball.moveUD = 0
ball.onEnterFrame = function() {
if (Key.isDown(Key.RIGHT)) {
this._x += 5
}
if (Key.isDown(Key.LEFT)) {
this._x -= 5
}
if (level.hitTest(this._x, this._y, true) ) {
this.moveUD = 0
while(level.hitTest(this._x, this._y, true) ) { this._y -- }
} else {
this.moveUD ++
this._y += this.moveUD
}
}
//and of course, to make the level rise:
level.onEnterFrame = function() {
this._y --
}
That's pretty much the most ghetto code imaginable, but it should actually work.
Everyone at home, if you want to learn how to code this game, you better be following along...
Doodle, sketch, draw, design, fill notebooks with elaborate scenes, funny character designs, and gameplay ideas.
Find your own personal style and run with it. Craft characters and stories that you love.
Enjoy your own work, and don’t be afraid to show it off. Create.