The basic building block is a counter chain, some simple counter chips in series. The horizontal counter chain counts clock pulses for a single horizontal video scan line, which is also used to generate the horizontal blank interval. Reset it each time, it reaches the end of a scan line. Now we have a digital counter in sync with the video signal. (Actually, we'll generate the video signal from this.) Another, vertical counter chain is used to count the rows and is pulsed each time, the horizontal counter chain is reset. Put a simple AND gate on the output of individual pins of the horizontal counters to put the output signal HI and you get vertical stripes. If we combine some output signals of the counters, we may narrow this down to single bar of arbitrary width. Do the same with the vertical counters and AND it with horizontal signal and you get what is known as a window, a basic rectangle.
So, how can we move this on the screen? Enter another set of counter chains, but this time with a bit of head room, which may be populated by a preset. These are known as slipping counter chains. E.g., have a 3-bit overhead and a preset of up to 4 bits, now the slipping counter chain will take head of the static one or fall behind it by up to 7 pixels in either direction, depending on the preset. (The extent of the "head room" is also known as the stop code, as setting the preset to that same value will result in a stationary signal. If the preset is zero, the counter chain will take 7 pulses longer to reach its end than the static one. If we fully populate the preset, it will finish early by the same amount.) If we start the slipping chain at a specific position of the static one, we may now move relative to it. Voila, we have a moving "window", which may be controlled by these preset values.
Basically, you need a set of slipping counter chains for each moving object and a set of static ones to generate the basic video signal and its sync pulses, as well as any static on-screen objects. For hit detection, just compare the signals emitted by those counter chains.
For some more detail (on the example of Computer Space) see: https://www.masswerk.at/rc2017/04/02.html
An amazing technical source on the subject is "The Textbook of Video Game Logic; Volume 1" by Arkush, William (Kush N' Stuff Amusement Electronics, Inc., Campbell, CA, 1976) [1]
[1] (PDF) http://www.tokensonly.com/images/resources/manuals/video-gam...