Giter Club home page Giter Club logo

plexis's Introduction

Plexis

CURRENT VERSION: 0.10.2

Plexis a breakout clone I wrote in C++/CLI because I wanted to play around with DirectX and experiment with an idea I had revolving creating GUIs using XML. It's built on top of a simple engine I wrote that makes use of DirectDraw 7 for graphics, DirectSound 8 for audio and DirectInput 8 for input. The level editor is written in C#, using WinForms; you'll need the .NET Framework 4.5 or later to run both the game and the editor. All the levels currently included are just debug levels; the emphasis is on gameplay at the moment.

The latest build of the game is in the build directory. All the source code is released under the MIT license.

Changes in 0.10.2

Game

  • Tweaked how the ball responds when colliding with a brick in particular cases.
  • Changed how the Jumbo and Shrink power ups work. Catching either power up now results in an incremental change to the paddle. If the player catches the Jumbo power up while the paddle has been shrunk, it'll return to the paddle to its default size. Catching it again will result in a jumbo-sized paddle. The opposite is true for the Shrink power up.
  • Added a sound effect to the See All power up.
  • Minor optimization in how each level is rendered; there was too much flickering when recording videos of the game.
  • Added the missing sound effect the extra ball power up.

Editor

  • Changed the size of the eraser cursor.

Changes in 0.10.1

Game

  • Fixed a bug where moving the mouse while waiting to respawn could result in the ball not being centered on the paddle.
  • Fixed a bug where the ball was getting stuck in indestructible bricks.
  • Changed how the ball moves. In rare instances, it was possible for the ball to bounce back and forth in a loop, never moving
  • down towards the paddle.
  • Tweaked the indestructible, insta-death and invisible brick art work.
  • Changed the prompt when the player finishes the game with a new high score.
  • Fixed a bug where the player could shoot lasers even after the paddle had exploded.
  • Fixed a bug where the wall would continue to descend when the player caught a wall power up while the wall was descending.

Editor

  • Maps can be assigned in the Change Order dialog by double clicking on them.
  • The editors name is now visible on the titlebar at start up.

Changes in 0.10

  • Fixed a bug where the ball was being attached to the bottom of the paddle if the paddle's frame changed.
  • Added the Jumbo, Shrink, Wall, Multi-ball, Fireball and See All power ups.
  • The game now uses a background image during gameplay.

Changes in 0.9.1

  • Fixed a bug where the error sound was looping whenever the player attempted to change a key binding.
  • When a ball collides with two bricks at the same time, the game will now treat both bricks as being hit.
  • Capped the ball speed so it can't pass through bricks or the paddle due to high speed.
  • PLeD now informs users when it can't load brick sprites.
  • Invisible bricks no longer need to be destroyed before the player can transition to the next level.
  • Added a sound effect that plays when the player purchases ammo.

Changes in 0.9

  • The player now has a permanent laser, with an initial ammo count of 90. Laser powerups now act as ammo packs when caught, awarding 30 ammo. Both the initial value and the amount of ammo awarded when a powerup is caught are specified in the lasers initialammo and pickupammo XML attributes.
  • Increased the chance of a powerup being generated by a brick when it explodes.
  • Added 4 new brick types: bonus life, ammo, instadeath and indestructible.
  • Each brick type in entities.xml can now specify whether they should be counted in the total number of bricks when a level is loaded. This allows for bricks that don't need to be destroyed in order for the player to transition to the next level.
  • Added the ability for players to purchase ammo packs at the cost of 1 life during gameplay. This is bound to the L key by default. The ammo packs are generated as powerups in the center of the screen and have to be caught.

Changes in 0.8.2

  • Scores are capped at 999,999. Previously it was 99,999. This also fixes the bug mentioned in issue 120.
  • Blank levels will no longer be loaded by the game.
  • A warning now appears when attempting to save blank levels in the editor.
  • The editor no longer allows previewing of blank levels.
  • Removed a blank button from the editor toolstrip that wasn't supposed to be there.
  • The default player name has changed from "DEFAULT" to "EMPTY" when the game writes out a fresh high score file.

Changes in 0.8.1

  • The size of the particles emitted by explosions has changed from 1 pixel to a block of 4.
  • Removed the mouse sensitity option from the options menu.
  • Usability enhancements to the editor.

plexis's People

Contributors

sethballantyne avatar

Stargazers

 avatar  avatar

Watchers

 avatar

plexis's Issues

Cancelling the save operation results in an ArgumentNullException being thrown

When editing a level that hasn't previously been saved (doesn't exist on disk), clicking File->Save then cancelling the save file dialog results in an ArgumentNullException being thrown with the following stack trace:

at Level_Editor.Level.Save(String path) in c:\projects\project ball buster\src\PBB\Level Editor\Level.cs:line 91
at Level_Editor.MainForm.SaveLevel() in c:\projects\project ball buster\src\PBB\Level Editor\MainForm.cs:line 150
at Level_Editor.MainForm.saveToolStripMenuItem_Click(Object sender, EventArgs e) in c:\projects\project ball buster\src\PBB\Level Editor\MainForm.cs:line 380
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.WndProc(Message& m)
at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Level_Editor.Program.Main() in c:\projects\project ball buster\src\PBB\Level Editor\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

Handle exceptions

There's no exception handling in the existing code, so.. do something about it.

Toolstrip button captions

Update the toolstrip buttons so they display caption when the user mouses over them. Include the keyboard shortcut in the description, where relevant.

Cursor object

It might be a good idea to encapsulate the menu cursor in its own object. In the pseudocode for MenuItemContainer::Render(), there's the line
int cursorXPos := items[i]->Position->X - menuItemCursor->Width - sizeOfGapBetweenCursorAndMenuItems

it could be replaced with something like
int cursorXPos := items[i]->Position->X - menuItemCursor->Offset

it makes it a little bit cleaner. Also, it might be a good idea to stick the value stored in sizeOfGapBetweenCursorAndMenuItems in XML so it can be changed during development without rebuilding the binary. If cursor is implemented as its own class, it'd be a good idea to stick its configuration in XML anyway. It could look something like this:

<asset type="cursor" name="menu_cursor" distanceFromMenuItem="8" />

the name refers to the bitmap stored in the resource manager. You'd keep it in the same XML file as all the other assets (obviously).

Handle garbage values in XML parser

The parser doesn't handle empty strings etc read from the XML file. If an asset defined in assets.xml contains bad data, it should be ignored.

Restoring DirectX interfaces is broken

Currently, DirectSoundBuffer and DirectDrawSurface objects will Restore(), but they're not being re-filled with the appropritate bitmap or audio data which makes restoring them somewhat pointless.

Refer to the index in HighScoreRow as 'rank'.

It confuses even me and I wrote the friggin thing. Rename rowIndexLabel to rankLabel, update documentation etc. It is a rank after all, so that's what it should be called. You'll need to revise SceneFactory and HighScoreTable, too.

Implement XmlHelper::GetAttributeValueAsUInt32()

Needed when parsing the slider's XML. SceneFactory::ParseSlider() is currently using XmlHelper::GetAttributeValueAsInt32() to read the sliders length, which of course means it's possible for it to interpret negative values which I don't want in this case.

HighScores::GetPlayerName() throws ArgumentOutOfRangeException when highscores.dat is empty.

When the highscores.dat is empty, it'd probably be a good idea to populate the list highScores with defaults to avoid this.

[08/05/18 20:56:39] Fatal Error: System.ArgumentOutOfRangeException thrown. Specified argument was out of the range of valid values.
Parameter name: row
Stack trace:
at HighScores.GetPlayerName(UInt32 row) in c:\projects\project ball buster\src\pbb\game\highscores.h:line 105
at HighScoreTable..ctor(Int32 x, Int32 y, Int32 numberOfRows, Int32 vertialSpacing, Int32 indexXPosition, String rowNumberFont, Int32 PlayerNameXPosition, String playerNameFont, Int32 scoreXPosition, String scoreFont) in c:\projects\project ball buster\src\pbb\game\highscoretable.cpp:line 106
at SceneFactory.ParseHighScoreTable(XElement element) in c:\projects\project ball buster\src\pbb\game\scenefactory.cpp:line 212
at SceneFactory.Read(XElement sceneXML) in c:\projects\project ball buster\src\pbb\game\scenefactory.cpp:line 365
at SceneManager.Initialise(XElement scenesXML) in c:\projects\project ball buster\src\pbb\game\scenemanager.cpp:line 40
at Game.Initialise(HINSTANCE__* hInstance, HWND__* hWnd) in c:\projects\project ball buster\src\pbb\game\game.cpp:line 106
at WinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, SByte* lpCmdLine, Int32 nCmdShow) in c:\projects\project ball buster\src\pbb\game\main.cpp:line 175

Refactor ResourceManager::Load* methods

LoadSoundBuffers(), LoadSurfaces() and LoadXML() all have shared code that can be refactored into a single method and called as needed. The two calls to Directory::GetFiles() can be reduced to one, as well.

KeyConfigLabel doesn't handle keys not in Input's lookup table properly.

When prompted for a key, pressing a key that's not in the look up table causes the control to release the cursor as if the new key has been set, but the caption doesn't change. I was able to move the cursor to the "Console" key binding after trying to change "Screenshot" and pressing right ctrl when prompted to press a key; also does it when pressing the print screen key.

keyconfigbug

Implement delete tool

Implement the tool that allows the user to delete bricks. Use the mouse cursor used by the BCC map editor so the user can differentiate between states.

Mouse speed slider displays the track box at the incorrect position

When setting the track box all the way to the left, it'll render it one step to the right (as if it's been incremented once) the next time the game loads.
slider1

Likewise, setting it all the way to the right will cause the track box to the rendered off the track the next time the game is run.
slider2

the track box can still be used in both instances. On the event it's rendered off the track, you can slide it back onto the track by pressing the left arrow key and it'll then function correctly, respecting the lower and upper bounds (but still render in the wrong place the next time the control is displayed).

Video documentation doesn't document all exceptions

The documentation for the Video class methods only documents the exceptions thrown by any DirectDraw functions called within that method. If a method in Video calls another Video method, the exceptions thrown by the callee aren't documented.

Input::ReadMouse() throws a DirectInputInvalidParameterException

[01/05/18 09:03:56] Fatal Error: DirectInputInvalidParameterException thrown. IDirectInputDevice8::GetDeviceState: an invalid parameter was passed to the function, or the object is an invalid state.

Stack trace:
at Input.ReadMouse() in c:\projects\project ball buster\src\pbb\game\input.cpp:line 347
at Game.Update() in c:\projects\project ball buster\src\pbb\game\game.cpp:line 169
at WinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, SByte* lpCmdLine, Int32 nCmdShow) in c:\projects\project ball buster\src\pbb\game\main.cpp:line 195

Terminate the game when there's no resource elements in paths.xml

Currently, an error message is displayed if paths.xml doesn't have any resource elements, but continues to execute, leaving the user with a blank screen. It's probably better just throw an exception and terminate; the relevant changes need to be made within ResourceManager::Initialise().

Replace caller with something more descriptive

MenuItem's can specify caller as an navigateTo argument in the XML file, which specifies they should cause a transition back to the previous scene. Rename this to something more descriptive, such as "previous" or "back".

Ensure error messages are consistent

Make sure the same message is used consistently for each exception, for example everywhere DirectDrawInvalidObjectException is thrown, make sure the error message reads "DirectDraw received a pointer that was an invalid DirectDraw object."

of course, each exception is going to need a standard message assigned to it first. (see issue #20)

Slider doesn't sanitize currentValue before use

It's possible to read a garbage value from GameOptions, which is assigned to currentValue in the slider's constructor. This value can be outside the bounds of the min and max values, which subsequently fucks with the line drawing code.

Remove magic numbers

Convert all magic numbers into constants, pictureBox_MouseMove is a good example of magic numbers being sprinkled everywhere.

DirectDrawInvalidParametersException thrown when alt-tabbing and then navigating to a new scene.

In the main menu, alt-tab so the game is minimized. Maximize the game, then navigate to another scene; a DirectDrawInvalidParametersException will be thrown. Here's the stack trace:

Fatal Error: DirectDrawInvalidParametersException thrown. IDirectDrawSurface7::Blt: one or more of the parameters passed to the method are incorrect.

Stack trace: at Video.Blit(Rectangle sourceRect, Rectangle destinationRect, Surface surface) in c:\projects\project ball buster\src\pbb\game\video.cpp:line 1352
at Font.Render(Int32 x, Int32 y, String text, Object[] args) in c:\projects\project ball buster\src\pbb\game\font.cpp:line 94
at Label.Render() in c:\projects\project ball buster\src\pbb\game\label.h:line 79
at MenuItem.Render() in c:\projects\project ball buster\src\pbb\game\menuitem.h:line 136
at MenuItemContainer.Render() in c:\projects\project ball buster\src\pbb\game\menuitemcontainer.h:line 172
at Scene.Render() in c:\projects\project ball buster\src\pbb\game\scene.h:line 149
at Game.Render() in c:\projects\project ball buster\src\pbb\game\game.cpp:line 135
at Game.Update() in c:\projects\project ball buster\src\pbb\game\game.cpp:line 175
at WinMain(HINSTANCE__* hInstance, HINSTANCE__* hPrevInstance, SByte* lpCmdLine, Int32 nCmdShow) in c:\projects\project ball buster\src\pbb\game\main.cpp:line 195

'new level' operation isn't aborted when it should be.

When choosing to create a new level, if the user chooses to save the level from the resulting prompt and then clicks cancel on the save file dialog, instead of cancelling the operation the editor proceeds to create a blank map. What should happen is when the user clicks cancel on the save file dialog, the user is returned to the map as if he'd clicked cancel on the save prompt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.