• Advertisement

Archived

This topic is now archived and is closed to further replies.

Car-game and DelphiX

This topic is 5450 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''ve made a car-game in 2d with the DelphiX-component. I have an image that''s scrolling down. And how can I know that the car is driving on something green (grass)?

Share this post


Link to post
Share on other sites
Advertisement
You can do pixel detection, but this is a little more complicated and there are better ways. You need to learn about collision detection, if you haven''t already. after you do, you can create areas that are dirt, areas that are grass, and so on. Then you can test the position of the car against these points. It sounds like your map is one giant picture. Not the best ways to do it, and this is one reason. If you did something like tiles, you would prob save memory, have a faster game, and be able to do easier collision.

--Vic--

Share this post


Link to post
Share on other sites
id agree... graphics should just be a representation of something and not the thing itself. you should draw a sharp line between the object in a game and the graphics you will see. a chest isnt a picture of a chest, its an object with dimensions, maybe a list of contained items and a position.. and a picture thats only used to show the player "hey, heres a chest".

Share this post


Link to post
Share on other sites
quote:
Original post by mr1989
Is there anywhere I can learn about pixel detection etc.?

Try DGDev - lots of Delphi developers over there who will have done this sort of thing before, probably.

Share this post


Link to post
Share on other sites

  • Advertisement