"Wouter van Teijlingen" <wo*****@nedlin ux.nl> wrote in message
news:ct******** **@reader08.wxs .nl...
Cor Ligthert wrote: Wouter,
That was what I understood, however there should be an interface between
your train and your computer in my opinion.
Or is it completly without any fysical beside the computer and is it
simulating.
I want to make the program without any fysical connection. It's all
simulated on the computer. The train is simulated on the computer, the
trafficlights and battle tree's. Just everything. I wondered if this was
possible to make in VB .NET.
-- Wouter van Teijlingen
You can do it, but I think it'd be dead hard to do anything beyond trivial.
Not just in vb.net, in any language.
One road and one car would be kind of easy.
Say.
The car just goes left to right until it comes to the lights... then
reappears on the left of the picture.
The lights turn from red to amber to green....
The car stops if < so-many-pixels from the lights if they're red.
You can hard code all the tricky bits.
You need a car.jpg a background.jpg and three lights.jpg.
Or maybe one lights.jpg and you draw a green/red/amber bit on it.
More cars and more roads is hurting my head just thinking about it.
You're tallking the sort of programming that games designers do.
You need to think about collision detection between the cars.
How do the cars "know" which road they're on and where it goes.
How do they work out that there are lights ahead.
The algorithm woukd be really tricky.
I'm not exactly sure how games designers do this.
I think there's like a mathematical model they use controls the movement and
where stuff is and hence collision detection.
This model is then used by the graphics bits.
So the lights being green is (say) a Light_Colour property of that light
object the buncha-cars-on-that-road will check to see if they move. It's
also one of the properties the stuff does the graphics will check as it
decides which of three lights.jpg to stick in the picture.
You heave inheritance to make vehicles then cars/trucks inherit from that.
Simulation is hard though.
I would imagine the vast majority of us on this ng do business programming.
--
Regards,
Andy O'Neill