Mich Robinson

Ranch Hand
+ Follow
since Jun 28, 2009
Cows and Likes
Cows
Total received
2
In last 30 days
0
Total given
0
Likes
Total received
8
Received in last 30 days
0
Total given
10
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mich Robinson

Thanks for the advice. I'll admit I come from a very procedural background and find OO a little weird. I did wonder why I saw definitions of arrays in the 2 formats ow I know.
Is there any performance cost in using arrays like this? or do I need to be more careful with garbage collection? I know this might not look pretty but it's infinitely better than the other approaches I've tried.

Many thanks for the fast responses!
Much appreciated.
5 months ago
I'm trying to develop a fairly flexible routine to move text  and images around a screen as part of a games library. There's a whole bunch of params that can be used so the position part might have X & Y and optionally a starting X & Y or perhaps no position info in which case it goes in the centre of the screen or perhaps it might reference one of the items on screen in which case the message will get printed near by. I have similar options on movement and timings and colours plus other random stuff. I don't want to have a single method with a 100 params. I tried defining different versions of the method that used different sets of params but I'd end up with 100's of methods instead. Today I started experimenting with passing a number of variable length arrays for the position, movement and timing info. This looked like a viable solution but

Is there a way of writing it like (A) that I'm missing?
Is there a better approach altogether?
The problem with (B) is that it looks messy and I'm not sure whether defining and creating all these arrays is efficient as it's used in various real time games.

Thanks for reading
5 months ago
Thanks for the replies. The manuals are useful when you know what you're looking for but personally I just don't know. I don't use maven etc but one of these days I might work it out. The post about the jars made me wonder what would happen if I just put the jar files in a zip along with the exe. This seemed to work when I created a new directory for the program but unfortunately it didn't work when a friend downloaded the zip, extracted it and tried to run it. It unpacked ok but nothing happened when they clicked the exe. If I did the same on my PC it runs fine. The exe was created by launch4j and is supposed to include its own java run time etc. I have to admit this is a little infuriating.

Any other suggestions for generating an exe program that people can just run? The game plays fine but my goal is to put the program on Steam and have it loaded (and run) from there.
1 year ago
A fat jar just includes all the dependant classes in the jar file.
I need the fat jar because I'm deploying the application as an exe via Launch4J.
When I move the exe to a different directory then it won't without the dependant classes being present.

My problem is I'm a bit of a dinosaur when it comes to java in that I don't use IDE's etc.
The commands I use to build my game and run it are:

How do I change this so the jar becomes a fat jar?

Many thanks

Mike
1 year ago
That's pretty much where I got the original code for doing full screen.
2 years ago
I write old style arcade games as a hobby but I'd like to try selling them on steam (you have to dream). I like to use low resolutions (800x600) because this matches the styles of the games. At the moment I use basic java for everything but I find it isn't very reliable when it comes to producing a full screen application and that's my big issue. I use the standard full screen stuff but on my own PC I need to set the run time flag nodraw=true else I just get a black screen while it runs fine on my son's PC. On my moderately widescreen laptop it just runs in a small window. I thought Java would be naturally suited to this but ...

I wondered about JavaFX but obviously I'd have the issue of learning a new library (I'm a bit slow witted when it comes to other peoples code). All I need is the ability to draw an image and write text, certainly nothing special. Does anyone else have this issue and did they find a solution? Any suggestions or simple examples?

2 years ago
... and I should of said that the above calls do load the native calls etc so I didn't have to do anything there.
2 years ago
I managed to get in touch with the developer and it simply turns out the init had to be called before the restartAppIfNecessary call. This sounds obvious but was a bit confusing in the docs (at least to me). It's all connecting quite well now! I guess I have to be a little patient and wait for my AppId to be issued before getting any further but I'm quite pleased with progress so far.
2 years ago
I suppose that does make sense. I guess the jar file provides an interface to the native library but doesn't actually supply the native library. I'll try and work out how to load that up now.

I'll admit I'm not very comfortable when I'm using other folks code. Even if they're much better coders than me. Hey ho.
2 years ago
Sort of. The program now compiles with the new jar file which is great but raises an error when calling the new stuff. I don't have a lot of luck when working with libraries which is why I tend not to use them. I think my code is doing the right thing. 'm using a publicly available AppId of 480 just to try and connect to the Steam. It's a baby first step of connecting and disconnecting but I'm getting an error. I have the jar file in the same directory and use code like the following:

But when I compile and run I get the following:
Looking up on the web this seems to indicate an unsatisfied native link error. My mind went a bit blank at this point. Am I missing something with how I'm importing stuff?

Mike
2 years ago
Yep, already been through those pages. My question is really simple. How do I import the jar package so it will compile. I don't use other folks packages much and I don't use an environment that does all this for me. I assume I store the the jar file locally and then reference it via an import statement. I've tried just about every combo I could think of but haven't hit upon the right answer yet. Any suggestions?

2 years ago
This is the output:

Sorry, it's a bit long.
2 years ago
I don't normally use anything but the standard packages supplied by java. I now want to use an package for connecting to Steam called steamworks4j.jar
I have the file in my local directory and am trying to import it but get the following error.


I tend to get into these situations and then start trying random variations until one works. Sadly I haven't been very lucky today.
Any suggestions?

Mike
2 years ago
Menu system: I finally understand what you're talking about In modern PC games you tend to click an icon on screen and just start the game up. This isn't the case with traditional arcade games as they run permanently 24/7 and try to attract customers to the game so they'll spend their money. These screens are called "attract screens" and tend mix advertising the game while showing information about the game, high scores etc. They are actually an appreciated part of traditional arcade games - when I first released this game, those playing the game on their arcade cabinets were upset they didn't have an attract screen! I had to compromise a little as I need to display what the controls are on a PC (WASD and space to fire or cursors and CTRL). I also have different playing levels for the player to progress through which is fine on a PC but isn't possible on an arcade machine where many different people of differing abilities will play.
5 years ago
Full screen: There appears to be an issue with Linux and with Windows Aero mode which doesn't allow full screen using the current resolution. I could change the resolution but then I'd have to alter all the graphics and a fair part of the program. I use a standard Java method to get full screen but sadly it doesn't seem to work on all systems. Did you try starting the game by double clicking the .bat program or the .jar program directly. Could I know what operating system you're on?

Menu system: Which menu system? Is it the pause/preferences menu? The game is actually meant for arcade cabinets (MAME) and users only have a joystick and a few standard buttons available so users wouldn't be able to operate a normal menu system. Users can move up and down the preferences menu with the joystick (or cursor keys or WASD) and cycle through setting values by clicking fire (space or CTRL). Most users shouldn't need to go into the preferences menu as it's set up for PC usage by default. The entry of names into the high score is simply the way names were entered into arcade machines - they don't have keyboards etc. A modern menu system would also detract from the retro nature of the game.

Power ups: The red mother ships allow you to power up your weapon or add lives or add shields. These appear every x number of screens. You also get 3 mothers on screen every 100K. Every 200K then the motherships allow you to have a "super" power up which can be a very fast shooting gun or shields that turn on automatically when you're hit by enemy fire or even a nuke which can be launched to destroy everything on screen (obviously you can only use them once). Most folk try to gather any weapon power ups available before going for other options.

Other features: There are boss screens every 100K which can be very different to other types of screen - ie you may need to just shoot the aliens walking on the surface or perhaps survive without shooting any aliens. Then there are actually 6 modes the game plays in - you start in the "campaign" mode where you need to earn your power ups etc. There's a "hard" mode where the aliens start tough and get tougher but you start with a fully powered weapon to fight back. Then there's a boss mode where you only get boss screens - this can require a lot more thinking than shooting. There's also extreme modes of each where you only get one life and no chance of adding extra lives.

B&W: I suspect that a black and white game in windows mode would only appeal to a few. I did try using an artist for the moon and aliens but it's difficult keeping people interested in a project especially when you can't afford to pay them.

Many thanks for playing it and for offering your thoughts.

Mike
5 years ago