Welcome Guest ( Log In | Register )

Outline · [ Standard ] · Linear+

 My first Win32 game prototype

views
     
flashang
post Feb 6 2025, 11:32 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(Mat Quasar @ Feb 6 2025, 03:49 PM)
Hi, this Win32 game prototype took me about 9 months from start to finish.

I started with console interface first, then finalized with GUI version.

It is written purely in FASM, using raw Win32 API.
Although it is in GUI, I use TextOutA function in GDI32.dll, which is just displaying text in GUI window, no graphics at the moment.

There is no collision detection yet, no scoring. What you can do with this program is:
1) Move the caret (gun) to the left or to the right
2) Shoot one bullet at one time
3) Watch the enemies moving around

user posted image

For the enemies to move around, I use random number generator to predict the direction of movement.

I have included the source code here (EXE is not included as it is falsely detected as virus).
If you are interested to run the program, you can....
1) Download SHOOT.txt
2) Rename SHOOT.txt to SHOOT.asm
3) Download Flat Assembler for Windows
4) Run FASMW.EXE and open SHOOT.asm
5) Click Compile
6) Go to the File Explorer, and you'll see SHOOT.EXE along with SHOOT.asm.

Note: If you compile yourself, Windows Security won't detect this as virus. Of course, my code does nothing malicious.

But my game is still very crude, I might consider using GDI+ or SDL2 to develop my graphical version of 2D game.
*
Personal Opinion :

Using any other library / 3rd party library (GDI+, SDL2, game engine, graphics / audio / video, ... ) are mean for improve visual, but not the main logic.

Port over to other system (web, mobile phone, different os, different cpu) need some different development tools.

Congras, you make the first move.

smile.gif


flashang
post Feb 9 2025, 04:33 PM

Casual
***
Junior Member
355 posts

Joined: Aug 2021


QUOTE(Kayziealnatz @ Feb 7 2025, 12:51 AM)
Between SDL2 and SFML, which one is more viable based on your personal exp
*
Personally, I would use unreal / unity for more complex projects.


as for SDL2 / SFML, reference from the internet :

-----
SDL2, or Simple DirectMedia Layer 2,
is a cross-platform software development library that provides low-level access
to audio, keyboard, mouse, joystick, and graphics hardware.

SDL is a cross-platform multimedia library designed to
provide low level access to audio, keyboard, mouse, joystick, etc.
It also supports 3D hardware via OpenGL.

-----
SFML stands for Simple and Fast Multimedia Library,
which is a cross-platform software development library written in C++.
It provides a simple interface for handling graphics, audio, and network functionalities,
making it popular among game developers and multimedia application creators.

SFML uses OpenGL under the hood and the main difference is that in OpenGL you will be writing your own renderer, 2D or 3D, from scratch.
SFML it easier to use because you have do less yourself.

-----

* depends on your development tool / familiar tool.

C -> SDL
C++ -> SFML

-----
If you're not create your own engine, use existing engine is preferred, as your project could expand more easily.


smile.gif



This post has been edited by flashang: Feb 9 2025, 11:01 PM

 

Change to:
| Lo-Fi Version
0.0140sec    0.42    7 queries    GZIP Disabled
Time is now: 2nd December 2025 - 10:47 AM