|
-
Senior Member
[HELP] On A Robot Game
I am in the early stage of making a robot game... (NOTE: im new at flash)
and can seem to get these things to work
what are the numbers decaliring in this
if(_root.Player._x+30>_x && _root.Player._x-30<_x &&
_root.Player._y+30>_y && _root.Player._y-30<_y)
also i am trying to make a box that when the player moves up agaist the block moves with the player this is what i got but... i can only move it sideways not ups have i forgotten sumthing??
onClipEvent (load) {
force_x=5;
}
onClipEvent (enterFrame) {
update=0;
if(this.hitTest(_root.Player._x-3,
_root.Player._y+_root.Player._height/2,true)) {
while(this.hitTest(_root.Player._x-3,
_root.Player._y+_root.Player._height/2,true)) {
_x-=1;
}
update=1;
}
if(this.hitTest(_root.Player._x+_root.Player._widt h+3,
_root.Player._y+_root.Player._height/2,true)) {
while(this.hitTest(_root.Player._x+_root.Player._w idth+3,
_root.Player._y+_root.Player._height/2,true)) {
_x+=1;
}
update=1;
}
if(this.hitTest(_root.Player._x+_root.Player._widt h/2,
_root.Player._y,true)) {
while(this.hitTest(_root.Player._x+_root.Player._w idth/2,
_root.Player._y,true)) {
_y-=1;
}
update=1;
}
if(this.hitTest(_root.Player._x+_root.Player._widt h/2,
_root.Player._y+_root.Player._height,true)) {
while(this.hitTest(_root.Player._x+_root.Player._w idth/2,
_root.Player._y+_root.Player._height,true)) {
_y+=1;
}
update=1;
}
if(update==1) {
while(_root.Level.hitTest(_x,
_y+_height/2+2,true)) {
_y-=1;
}
while(_root.Level.hitTest(_x,
_y-_height/2-2,true)) {
_y+=1;
}
while(_root.Level.hitTest(_x-_width/2-2,
_y,true)) {
_x+=1;
}
while(_root.Level.hitTest(_x+_width/2+2,
_y,true)) {
_x-=1;
}
}
IS THERE AN EASER WAY !!!!!!!!!!!!!!!!!
Last edited by Gloo pot; 08-22-2005 at 08:03 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|