top_left top_right
bottom_left
Next Event: Unknown | Forum Rules | QGL Website | Event Registration
openFolder AusForums.com
iconwatfolderLineopenFolder LANs
iconwatfolderLineopenFolder QGL
iconwatfolderLineopenFolder QGL Forum
Author
Topic: Flash MX ActionScript help
threE deE
Posts: 659
Location: Brisbane, Queensland
i am teaching myself actionscript in flash mx and using this knowledge as i learn it i want to make like a topdown view run around flash game. ive only just started it and and wanted to get the movement and stuff done first.

This is code that i have applied to the player's character object:

onClipEvent (enterFrame){
// Set Variables
speed = 2.5
angle = 5

// Move Forward
if (Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)){
_y -= speed*Math.cos(_rotation*(Math.PI/180));
_x += speed*Math.sin(_rotation*(Math.PI/180));
}
// Move Backward
if (!Key.isDown(Key.UP) && Key.isDown(Key.DOWN)){
_y += (speed/2)*Math.cos(_rotation*(Math.PI/180));
_x -= (speed/2)*Math.sin(_rotation*(Math.PI/180));
}
// Turn Left
if (Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT)){
_rotation = _rotation - angle
}
// Turn Right
if (!Key.isDown(Key.LEFT) && Key.isDown(Key.RIGHT)){
_rotation = _rotation + angle
}
}

how would i - using hitTest and getBounds make the object detect that its hitting something and stop moving or something. kind of like the Maze.fla in the flash samples folder except with round and curvy walls and the better movement.

Thanks
system
--
defi
Posts: 792
Location: Brisbane, Queensland
pssst put a subject on man

edit: Thats better :)
threE deE
Posts: 660
Location: Brisbane, Queensland
thanks for helping guys :)
system
--
Not a new post since your last visit.
New Post Since your last visit
Back To Forum
Advertise with Us | Privacy Policy | Contact Us
© Copyright 2001-2026 AusGamers Pty Ltd. ACN 093 772 242.
Hosted by Mammoth Networks - Australian VPS Hosting
Web development by Mammoth Media.