To accommodate the exponentially increasing computation demands of vehicle-based applications, vehicular edge computing (VEC) system was introduced. This paper considers a three-layer VEC architecture and proposes an online offloading scheduling and resource allocation (OOSRA) algorithm to improve the system performance. Specifically, this study designs a game-theoretic online algorithm to solve the problem of computation task offloading scheduling, and employs an online bin-packing algorithm to compute the resource allocation modified from the First Fit algorithm, which can be adapted to various traffic flow and service attributes. Extensive simulations are conducted, and a numerical analysis of simulation results verifies the effectiveness of the OOSRA-VEC system. The algorithms proposed in this paper are online, adaptive, and distributed, which can provide useful references for future development in VEC system protocols. INDEX TERMS Intelligent vehicles, intelligent transportation systems, edge-computing, game theory.