Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi all, I'd like to recreate the old lightgun in coppercube. For now I've set up a calibration screen which detects the offset by clicking in different areas. BUT; how did the guyz back in the '80s/'90s did the calculations? The mathematical routing behind it? For now i've got this: - Left/Right/Top/Bottom offset data But how gets the math inbetween absolutes beeing calculated? For example; the center point should get all offsets; but the closer to the center it should be the overall average of all 4 offsets? I'm not a coder, you can tell - I'm sure I totally overthink it atm.... Maybe someone can enlighten me to become a matchstick :) Thanks all |
||||
|
Hi, To tell the truth, I don't think there was a lot of math related to the light gun, if I understood what you're talking about correctly:) The gun itself had a photosensor on its point. As you press the trigger, the screen turns black for a couple of frames. All sprites which could be shot, swapped to white hitboxes. So in case you point the gun, i.e. the photosensor to the area there the sprite was (to the white hitbox), photosensor detects light and outputs HIGH signal. In case you're pointing the gun outside the hitbox, i.e. to the black screen area photosensor output is LOW. Based on that output signal game console decides if the target is hit or not. If you have multiple potential targets, the hit box appear one by one, i.e. the screen stays black for more frames. |
||||
|
Thanks @okeoke - wasn't aware of the oldschool techniques :) awesome what they did back at that time |
|