VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



A Dash Thru the Woods

by Robert Rayment (69 Submissions)
Category: Graphics
Compatability: Visual Basic 3.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (6 Votes)

A Dash Through the Woods by Robert Rayment. UPDATE: Improved bitmap creation (Having been goaded by Paul) plus some simple sound. This prog is based on the triplet StretchDIBits, byte arrays and assembler (as with 'Tunnels & Things' which got 10 excellent votes) except I've left out the assembler which means that it MUST be compiled so that the array manipulations are again dealt with by machine code. The prog will only produce a large bitmap file of smaller trees from a starting bitmap ONCE so that later runs can load up the byte arrays quickly. The creation of the bit maps is fast enough now so you could leave out the save to disk if you wanted to. It shows some other uses for StretchDIBits and 8-bit color byte surfaces, which might be of interest to some of you. No assembler is used. Trees are then put onto a drawing surface starting with the smallest and ignoring a white surround (masks not needed). By keeping and adjusting the x-position, direction and type of tree it looks like moving through some woods. Timing (using GetTickCount) and hence speed, the number of tree starts and their spread are on an options menu. The left & right cursor moves a little car to the left & right (actually the trees move in the opposite direction) and the up & down cursor changes the speed. You have to try not to hit the trees. Collision detection is based on x-coords. It needs compiling to an EXE to get a decent speed. Don't expect DirectX quality but I think its fun! The Zip file is 54 KB.

Assumes
Nothing special
Code Returns
Game
Side Effects
Produces a binary bitmap file once
API Declarations
StretchDIBits plus a couple

Rate A Dash Thru the Woods

Download A Dash Thru the Woods

Download A Dash Thru the Woods (53 KB)

A Dash Thru the Woods Comments

No comments have been posted about A Dash Thru the Woods. Why not be the first to post a comment about A Dash Thru the Woods.

Post your comment

Subject:
Message:
0/1000 characters