Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Actionscript hit detection
New Posts  All Forums:Forum Nav:

Actionscript hit detection

post #1 of 3
Thread Starter 
I'm making a small game for my AS course.

The basic premise of the game is a missile launching after clicking on the stage, and then following where the cursor goes.

I have made a small level for it to avoid and to go around. I just need to find a way to detect when it hits the walls of the level.

So, if you could link me to a simple guide for hit detection, as all google searches i have done have come up with nothing that works.

The level is basically a twiggly circle, so even if the missile is "inside" the level, it shouldn't fail.

Right now, it explodes as soon as i click on the stage and the addChild function activates.


The focus point thing on the level object is on the spot i want the missile to appear on, so i can just put the missile and the level on the same x and y values...

Feel free to ask questions if it helps you help me, i'll be refreshing this page quite a bit while trying to figure this out.

thumb.gif
Computah
(18 items)
 
  
CPUMotherboardGraphicsRAM
2500k @4.5 Asus P8Z68-V GEN3 MSI 770GTX Twin Frozr Gaming 2x4Gb Ripjaws X 
Hard DriveHard DriveCoolingOS
2x HyperX Fury 240gb Raid0 WD Red 3TB NH-D14 Windows 10 Pro 64b 
MonitorMonitorKeyboardPower
Acer X233H 23" BenQ G2420HDB 24" Ducky Shine 3 TKL Corsair TX 750 
CaseMouseMouse PadAudio
HAF 912 PLUS Logitech G400s Roccat Taito Beyerdynamic DT-770 Pro 80ohm 
  hide details  
Reply
Computah
(18 items)
 
  
CPUMotherboardGraphicsRAM
2500k @4.5 Asus P8Z68-V GEN3 MSI 770GTX Twin Frozr Gaming 2x4Gb Ripjaws X 
Hard DriveHard DriveCoolingOS
2x HyperX Fury 240gb Raid0 WD Red 3TB NH-D14 Windows 10 Pro 64b 
MonitorMonitorKeyboardPower
Acer X233H 23" BenQ G2420HDB 24" Ducky Shine 3 TKL Corsair TX 750 
CaseMouseMouse PadAudio
HAF 912 PLUS Logitech G400s Roccat Taito Beyerdynamic DT-770 Pro 80ohm 
  hide details  
Reply
post #2 of 3
It's been years since I coded in AS3 but I'll try to help. Could you sketch the level you're trying to make? Just so I can picture it better?
post #3 of 3
How accurate of hit detection are you looking for. You can go anywhere from pixel perfect hit detection to generalised hit detection. It would probably really help to see a picture or something of the level just to see what types of object. 3d or 2d?
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
Reply
    
CPUMotherboardGraphicsRAM
Q6600 DG33TL XFX 6950 2GB 4gigs Corsair XMS2 DDR2 
Hard DriveOptical DriveOSMonitor
1.5TB seagate 2X640GB Samsung DVDRW Windows Vista & Debian Linux Samsung 19" + Acer 24" Wide 
KeyboardPowerCaseMouse
Microsoft SideWinder X6 Antec 750 TruePower Raidmax Smilodon COOLER MASTER Sentinel 
Mouse Pad
RocketFish 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Actionscript hit detection