Well I have been writing programs on and off since the BBC micro (at a fairly basic level), and there has always been an accepted way of doing things. For example I am currently trying to write a platform game. The accepted way of doing this has been to use a grid system and check a number of grid squares round the character for collisions. I wrote a couple of programs like this on my old Amiga A500 (8Mhz CPU).
However since modern PCs are vastly more powerful - loads of memory and power I figure I can create any background I want (in an art package) and then use ImageCollide(image,x,y,0,background,0,0,0) to check for collisions. This means I don't have to draw platforms to a grid, and that slopes become very easy to implement, and I can destroy bits of platforms and do other stuff very easily which would have been a lot tougher to program using the old accepted way.
Is this a good idea? I've got a simple platform game up and running, but it slows down a bit (with debug on), and I'm worried when I get more objects on screen, all doing background collision checks, its going to get very slow.
Can I speed up collison checks my using a dummy reduced-color background (so there are less layers?). I don't really know why doing an imagecollide of a character(32 x 32) with a large background (1024 x 768) should be so hardwork for a modern PC, especially when you see whats possible in 3D these days.
I would like the thoughts of more experienced programmers on this technique - if I could use it, then it would be great because it requires a lot less effort, and is quite flexible - I can have any shapes in my background, and its easy to add enemies. I'm just worried about it being very slow. I'm using 16bit color depth by the way.
Would someone also tell me what pixmaps and collision layers are exactly, the manual doesn't really explain?
Thank you for any help :)
Rico
However since modern PCs are vastly more powerful - loads of memory and power I figure I can create any background I want (in an art package) and then use ImageCollide(image,x,y,0,background,0,0,0) to check for collisions. This means I don't have to draw platforms to a grid, and that slopes become very easy to implement, and I can destroy bits of platforms and do other stuff very easily which would have been a lot tougher to program using the old accepted way.
Is this a good idea? I've got a simple platform game up and running, but it slows down a bit (with debug on), and I'm worried when I get more objects on screen, all doing background collision checks, its going to get very slow.
Can I speed up collison checks my using a dummy reduced-color background (so there are less layers?). I don't really know why doing an imagecollide of a character(32 x 32) with a large background (1024 x 768) should be so hardwork for a modern PC, especially when you see whats possible in 3D these days.
I would like the thoughts of more experienced programmers on this technique - if I could use it, then it would be great because it requires a lot less effort, and is quite flexible - I can have any shapes in my background, and its easy to add enemies. I'm just worried about it being very slow. I'm using 16bit color depth by the way.
Would someone also tell me what pixmaps and collision layers are exactly, the manual doesn't really explain?
Thank you for any help :)
Rico