Jump to content

FLASH problem: Car game, too big region around the car!

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
Zoroaster

Zoroaster

    Newbie

  • Members
  • Pip
  • 1 posts
Hi. I've created a car game... actually its more like a maze game except you drive a car and with your arrowkeys instead of the mouse. Anyway... Whenever I turn the car diagonally the region of the car wont turn with it. It will stay in a square around the car with straight lines making the region of the car almost TWICE the region of the actual design.

Here's a picture of the game so you know what it's about:

Posted Image

It works pretty well and it's fun. But as I explained before... The region of the car is MUCH bigger than the actual design itself. Take a look. Here i put "Show redraw regions" on to show you. It's not possible to drive through where the car is even though it looks like it is on the design, but as you can see on the actual region, it's not possible!


Posted Image

So please.. if you have any idea how to fix this issue I'd really appreciate it. Even if you don't know I appreciate any form of suggestion to fix this. Thank you for your time!

#2
Guest_johnny.dacu_*

Guest_johnny.dacu_*
  • Guests
This is happens because every flash object is a square. and the square is obviously bigger than object itself. when you make the hitTestObject, the square is tested. Maybe if you put in your car object 4 point corners or something, and actually test the hit by this points. You'll have more code, and aditional checks offcourse.