Example Program Drafts

cancel
Showing results for 
Search instead for 
Did you mean: 

Platformer Game with OOP (New Year's Resolution)

I resolve to always consider an Object-Oriented approach when starting new projects in LabVIEW

Description


Object Oriented Programming is a very powerful approach to software architecture and programming that allows writing modular and reusable software systems. It is not only LabVIEW-specific and it is actually commonly used in the majority of larger-scale applications.

I have discovered the benefits of it when developing a 2D Platformer game concept in LabVIEW. At first I did not use objects and struggled to make multiple instances of enemies. Later I found out about LabVIEW OOP and found out how this can be implemented into my game. Once I fully understood how to apply these fundamental principles of object-oriented programming in LabVIEW environment I was able to use it in my platformer, what allowed me to create infinite number of enemy instances that were defined as objects. This made the code significantly more modular and much easier to maintain.

Therefore I decided that for my new year’s resolution I will aim to use Object-Oriented Programming with applications of larger scale from the beginning to exploit all the benefits of this software design approach.

screenshot.png

screenshot2.png

Steps to Implement or Execute Code

  1. Download the project archive.
  2. Extract it to a know location.
  3. Run the "Game Project.lvproj" file.
  4. Run "Game.vi" file from the project explorer in LabVIEW.

How to play

Use keyboard buttons to navigate: LEFT/RIGHT to move horizontally and UP key to jump.

While in air, press DOWN to perform a stomp attack. You can also enter cheats ("Health Please" for a health boost, "Points Please" for extra points).

If you run out of HP you will be presented with a pop-up window saying "You're dead" and then your health points will re-initialise. Enemies will be spawned in random locations within the map and each will have a random speed.


Requirements

Software

LabVIEW 11.0 or newer.


My Other New Year's Resolution is to...

______________________________________________________

Mark N
Applications Engineer
National Instruments UK & Ireland
Comments
Active Participant RogerIsaksson
Active Participant

Cool, but,

where's the video of the awesomeness (for people out there without LV)?

Br,

/Roger

Member NI-MarkN
Member

Thanks for the feedback!

As suggested I've uploaded a youtube video.

______________________________________________________

Mark N
Applications Engineer
National Instruments UK & Ireland
Member Feryal
Member
can u help me pls to reproduice the code
Contributors