Posts Tagged ‘Cursors’

Some updates

Tuesday, February 3rd, 2009

Well, the bad news is, this project is not currently my top priority so it may be a while until I get back to working on it full time. The good news is, this project still has a special place in my heart and I still spend quite a bit of time thinking about it. Even though this is not my top priority, I still have found some time to do some minor coding on some of the smaller features.

I have added unit order queuing and some simple code to show those orders so now the units can be moved through multiple waypoints effortlessly. I’ve also added the distinction to separate your units from enemy units, and adjust the cursor icon as necessary. This also includes code to prevent you from moving or mass selecting enemy units. I haven’t incorporated actual teams yet, which will allow for allied units that are not yours to control, but not enemies to attack, but that will be the next addition. I’ve added some minimal code to link the GUI to the action by showing the currently selected units in the bottom left of the screen, giving a count for each unit type and listing every unit. I’ve added code to allow the game to be played at any resolution, and even full screen, but for now the game will remain at a constant windowed size. I’ve added a splash screen. Recently, I’ve added the text display part of the GUI that will inform you of unit completion or base attacks. This has all been added and tested but still needs a little tweaking and I will probably incorporate much of it into the current scripting system, but that’s a task for another day.

All in all, I am bummed out that I can t spend much more time on this, but it does give me something to look foreword to when I finish the other projects I’m currently vested in.

Bugs in the new mouse engine

Sunday, May 4th, 2008

While the new mouse engine did fix countless obvious bugs and prevent lots of future headaches, that’s not to say that it didn’t come with a few bugs of its own. To start, because the new system was repositioning the now invisible mouse cursor to the center of the screen, it had some issues that arose whenever I would try to move the window from its default loading location. I also have to convert all of the old mouse action code to flow through the new mouse system. In addition, because the new mouse engine locks the cursor inside the window, i added a procedure to unlock the cursor when pause to allow the user to exit the exit or perform other tasks when necessary.I also fixed a bug that popped up that was throwing the scroll engine into overdrive ever since I started painting the cursors with the graphics engine. After finishing all of that, and finalizing the new mouse engine I made one final change and fixed some of the liking for use hovering and mouse cursor sensors to show off some of the new cursors. At this point the new mouse engine and taken the full load and has completely replaced the stock old one, which leaves me with no other choice but to move on to bigger and better, and cooler tasks.

New mouse engine

Friday, May 2nd, 2008

After returning to the RTS again, I decided that I would no longer live in fear of the major unit issues that I had run into before. When I last worked on the RTS I discovered that because I was using Java’s swing classes just for their mouse listeners, the class was running much more code then was necessary for my needs. For example, every time I would change the cursor, every swing child would automatically repaint, which was totally unnecessary because I am maintaining my own graphics engine. To correct this, and numerous other problems that were a result of using the swing classes, I changed the type of my base game object to no longer extend swing’s JComponent. I also went ahead and stripped out the old mouse engine which let windows control the mouse, and replaced it with my own. My new custom mouse engine allows me to much more control over what the mouse can, and cannot do. By handing all mouse movement from within the Java code, I can easily, and smoothly, lock the mouse inside the window making scrolling and other complex interactions much simpler.

With the new mouse engine I have added modifiers for numerous things that I could not have controlled before such as mouse sensitivity and also allows me to handle all mouse actions a new all in one procedure. Because the new mouse engine is running from within the Java I can directly what happens when the mouse is pressed and no longer have to worry about mouse listeners or which object is on focusable or anything else. With this great progress I hope do some more work with the units soon.

New cursors

Tuesday, April 8th, 2008

After returning to work on the RTS I decided to start by fixing some the problems that were on my mind. I knew the major painting problems needed to be fixed soon, but I decided to first start by working on new cursors, and a completely new mouse management system. In previous versions, to achieve cool cursors I simply just changed the current windows cursor icon to one of my custom cursors. The new system I have put in place is completely new and different. In addition, to solve the issue of the cursor leaving the screen when I didn’t want it to, I decided I would lock the cursor in the center of my application, and let my graphics engine render the cursor. With the windows cursor locked in the center of the application, i simply measuring the distance traveled and on each move and adjusting the rendered cursor location accordingly. In addition, I replaced the windows cursor with a transparent image, so the windows cursor is completely unnoticeable and the user never even imagines that the change has been made.

Hey, those are units…

Tuesday, March 4th, 2008

Demo 009

After months of coding and design, the game is finally taking shape as I can now handle units on the screen. I put several finishing touches on the selection system and the scroll system to prep the RTS for another build. Also I have recently added numerous new script variables to a root script file that allows my other developers and I to very easily tweak the code before it runs. I added script variables for screen size, tile size, an array of GUI/mouse interaction variables, nearly all variables involved in the scroll system, and even variables to set preferred frame rates in the graphics engine. I am still amazed at just how helpful these script variables can be, and how they make the designing of the game much more simple and enjoyable.

(more…)

Now thats a GUI

Monday, February 25th, 2008

Demo 008

Finaly I’m done with the scripting portion of the GUI. Though I’m sure that I will need to modify a thing of two as I start witting other code to interact with the GUI, but still it feels like a big accomplishment. While finishing touches on my script code for the GUI, I was also working on the cursor animation engine which is also up and running beautifully. Sadly, because the cursors are automatically removed from the screen shot, my cool animated cursors don’t appear in the picture, but I assure you they are very cool. In almost no time at all, after minimal explanation, I was able to hand off the script files to my game designer and he was able to construct his own version of the GUI as seen above. He was also able to modify the new cursors file, and using a constant code base, work with multiple new cursors and see how they looked in the real engine. Before I knew it, he had completely redesigned by default test GUI (bellow) into something that looks much yet functions exactly the same.

(more…)

Now with cursors

Friday, February 22nd, 2008

Been back to work for a few days now, and everything is going fine, but it doesn’t seem like I’m getting much done. Most of what I’ve ended up working on has been little stuff, or small tests, or just cleanup work that can get old real quick. I worked on my GUI a little bit more, but spent most of my time on the new cursor system. All of the ground work for the cursors is written, and in place, including all the code to handle how cursors move over units, non selectable objects, the GUI, and even the code to show scrolling. All of this is good news but unfortunately this addition brings little moral as I have no actual cursors to use. To test most of the system i have used some dummy pictures but I seem to be too tired to enjoy my work. For now I’ll sleep it off and hope that some flashy animated cursors will arrive soon.