VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Tile Engine (tiler,res change,wav & midi player)

Mike Miller  (2 Submissions)   Games   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This will make it easy for someone to make a cool tile game. The coding on their part will take basicly nothing and produce a quality game. It also has a wav player, midi player and some other stuff. Check it out! The reason I made this is because every place i went to look for a tile engine, either didn't have one or the code was all in the form and was really jacked up. With the engine that I made([email protected]) it is all in a moudle and very easy to understand. It currently supports up to 35 diferent tiles but that can be changed to make it more. MAKE SURE THAT AUTO-REDRAW IS ON! If autoredraw isn't true then you will have to make sure that all the picture boxes that are being used as the input are still visable to the user.
'Newly updated ---- I forgot to add about a transparent bitmap in here, so people who want just that, just steal that and take it. Also I want everybody to know that this engine is fast, because it uses BitBlit ( Bit Blit or Bitmap Blaster) not paintpicture. There is no reason that I can see to use direct-x for a tile engine, BitBlit is fast enough.

Inputs
The map file, if it isn't self explanitory, email me. And the PictureBoxes. Other than that there is some stuff if you want to use the non-engine part of the moudle. The File Name For the WAV, Or MIDI, and the requried inputs for the transparent bliter.

Assumes
TURN AUTOREDRAW ON!!!!!! If something is wrong, just try refreshing the form, in a timer with intraval of about 500 do me.refresh timer1.enabled = false end sub This will make everything better if it doesn't work.

Returns
A BitBlited Form of a large picture produced by many tiles, or even just 1 tile, it doesn't really matter.

Side Effects
Beware of an extreamly cool game made by you with this engine. None Other than that though, if you find one, e-mail it to me and I will correct it and send you the corrected code along with everyone else who reads it, and you shall get some credit for helping me.

API Declarations
'''''''''''''''''''''''TM
'''Funky Tile Engine'''
'''Mike Miller '''
'''1999 '''
'''''''''''''''''''''''
'autoredraw must be true!
'[email protected]
Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Declare Function mciGetErrorString Lib "winmm.dll" Alias "mciGetErrorStringA" (ByVal dwError As Long, ByVal lpstrBuffer As String, ByVal uLength As Long) As Long
Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long
Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (ByVal lpSound As String, ByVal flag As Long) As Long
Public Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
Public Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Public Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Public Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Public Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Public Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function EnumDisplaySettings Lib "user32" Alias "EnumDisplaySettingsA" (ByVal lpszDeviceName As Long, ByVal iModeNum As Long, lpDevMode As Any) As Boolean
Private Declare Function ChangeDisplaySettings Lib "user32" Alias "ChangeDisplaySettingsA" (lpDevMode As Any, ByVal dwflags As Long) As Long
Const CCDEVICENAME = 32
Const CCFORMNAME = 32
Const DM_PELSWIDTH = &H80000
Const DM_PELSHEIGHT = &H100000

Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type DEVMODE
dmDeviceName As String * CCDEVICENAME
dmSpecVersion As Integer
dmDriverVersion As Integer
dmSize As Integer
dmDriverExtra As Integer
dmFields As Long
dmOrientation As Integer
dmPaperSize As Integer
dmPaperLength As Integer
dmPaperWidth As Integer
dmScale As Integer
dmCopies As Integer
dmDefaultSource As Integer
dmPrintQuality As Integer
dmColor As Integer
dmDuplex As Integer
dmYResolution As Integer
dmTTOption As Integer
dmCollate As Integer
dmFormName As String * CCFORMNAME
dmUnusedPadding As Integer
dmBitsPerPel As Integer
dmPelsWidth As Long
dmPelsHeight As Long
dmDisplayFlags As Long
dmDisplayFrequency As Long
End Type
Dim DevM As DEVMODE

Rate Tile Engine (tiler,res change,wav & midi player) (101(101 Vote))
Tile Engine (tiler,res change,wav & midi player).bas

Tile Engine (tiler,res change,wav & midi player) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters