![]() | Register | FAQ | Members | Social Groups | User Map | Calendar | Search | Today's Posts | Mark Forums Read |
| ||
| | | LinkBack | Thread Tools | Search Thread |
| Sponsored Links |
| | #1 |
![]() Join Date: Nov 2009
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0 | Thankz:P |
| |
| | #2 |
![]() Join Date: Dec 2006 Location: Minehead, Somerset
Posts: 6,636
Thanks: 180
Thanked 490 Times in 400 Posts
Blog Entries: 14 Rep Power: 135 | I'm not particularly a flash expert, but collision detection is pretty much the same whatever language. You need some form of script to monitor the objects, and see when their boundaries cross/touch. This video may help: |
| |
| Thanks to localzuk from: | Jonny_5 (28-11-2009)
|
| | #3 |
![]() Join Date: Nov 2009 Location: Gloucestershire
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0 | is it as2 or as3? When you move the car you want to get it's x and y position. Then use an if statement so that: if(car.x < 0) { // hit the left wall } else if(car.x > Stage.width) { // hit the right wall } if(car.y < 0) { // hit the ceiling } else if(car.y > Stage.height) { // hit the floor } You can adjust the values to take into account the car's width by using this instead: if(car.x-(car.width/2) < 0) Failing that use the hitTest method, placing movieclips around the outside. Check the Flash help for hitTest |
| |
| | #4 |
![]() Join Date: Nov 2009
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0 | its as3 but thnx for the tips (: |
| |
| | #5 |
![]() Join Date: Jun 2005
Posts: 1,625
Thanks: 2
Thanked 20 Times in 16 Posts
Rep Power: 20 | you need the hittest i.e. if (car.hitTest(line1)) { gotoAndStop(2); } if (car.hitTest(end)) { gotoAndStop(4); } }; Instead of goto and stop, you could have nextFrame Send me your email address, and I'll email you some working code as a demonstration! |
| |
| Thanks to StewartKnight from: | Jonny_5 (30-11-2009)
|
| | #6 |
![]() Join Date: Nov 2009
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Rep Power: 0 | my email adress is jonnyebr@hotmail.com thnx alot |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| plagiarism detection | PEO | General Chat | 9 | 08-01-2010 12:50 AM |
| HP Procurve High collision or drop rate errors | techie08 | Networks | 1 | 12-03-2009 12:37 AM |
| AP's with rogue AP detection | Jobos | Networks | 1 | 02-03-2009 07:20 PM |
| Hardware Detection | Mr.Ben | Windows | 1 | 20-05-2008 10:08 PM |
| Detection of flash within browser regardless of .. | mac_shinobi | Web Development | 3 | 31-08-2005 03:32 PM |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search Thread |
| |








