Dark Bit Factory & Gravity
PROGRAMMING => Other languages => Blitz => Topic started by: valis on January 18, 2011
-
Game logic not entirely finished, just a one-night coding binge. Starfield is from bmax code archive, the rest is mine.
Source removed; not everyone has blitz installed. Sorry to be a bother
-
any way to get a compiled version for ppl dont own/have blitz installed? ;) thanx
-
http://dl.dropbox.com/u/590198/space%20gimps.exe
-
If you add these three lines to the top of the code, you will get an exe that is about 161kb in size, or just over 63kb if upx compressed.
Framework BRL.GLMax2D
Import BRL.Random
Import BRL.PolledInput
Cool game by the way. I like the way the objects are made from squares. Very retro.
-
@valis:
very very nice game! I really like the pixelated objects, the pixelbased particle explosion and even the nice details like stars moving to left while player moves to right and the other way! About the procedural generated objects, i saw something simillar somewhere on web long time ago... I am not really sure where is saw it. However its really amazing and thanks for sharing the source, so ppl (like me) can study and learn how to code such a nice galaga like game :) K++ for the really very nice game and its source! :)
-
Zawran: Thanks, was wondering about that. Any way to collapse it under 64k?
Va!n: The only game I know of that uses that is Invaders: Corruption, a great game. I got the idea initially from a Processing project someone did a long time back, maybe the same guy who did Corruption.
Watch this space, I'm going to get some more behaviors and variations in and finish the game logic.
Anyone have any ideas on writing wav files in memory?
-
@valis:
Writing waves to memory should not be so hard! Just take a look how the WAV fileformat looks like (File-/HeaderFormat)... Its very simple and easy to understand... Just allocate the needed memory, write the header stuff and then begin to caclulate and write your generated audio (wave) to the memory... Just begin with a simple SIN tune ^^ Good luck
Just check the web for the RIFF WAV fileformat...
https://ccrma.stanford.edu/courses/422/projects/WaveFormat/ (https://ccrma.stanford.edu/courses/422/projects/WaveFormat/)
http://de.wikipedia.org/wiki/RIFF_WAVE (http://de.wikipedia.org/wiki/RIFF_WAVE)
-
Blitzmax has a module for creating sounds in memory, which you can then play. It could be used to create sounds for the game. Take a look into the BRL.AudioSample module.
Local sample:TAudioSample=CreateAudioSample( 1024,11025,SF_MONO8 )
For Local k=0 Until 1024
sample.samples[k]=Sin(k*360/32)*127.5+127.5
Next
Local sound:TSound=LoadSound( sample,False )
PlaySound(sound)
Delay 100
-
Thanks for all the help. This is only my second largish program with Max so I have a lot of questions.
-
No problem, glad that I can help. It looks like you are off to a great start I would say.
-
This is really cool :) Good idea and nice execution!
-
This is really excellent, I love the way that the aliens explode.
-
Game logic is finished, scoring added, several new enemy types and behaviors. Weapon upgrades. Difficulty scales. Attract mode added.
Source code above is now updated, as is this:
http://dl.dropbox.com/u/590198/space%20gimps.exe
I would like to release this on TIGSource so anyone who wants to playtest this and comment, I would appreciate it. Enjoy!
It's Sofa King hard. It makes DoDonPachi look easy. This is the way games used to be in 1982 or so...
-
Really great game! Having a lot of fun while playing and hearing music in the background ^^
Btw, probally some tiny things that could be changed/fixed/improved:
- Center "HiScore" display... Atm it seems to be more right instead centered
- FontBackground of "SpaceGimps - Press Space to Start" is black instead transparent background color like you are using for the "HiScore" display.
- When starting the game, the HiScore shows a score of 4850... But everytime when starting to play a new game, the HiScore will reset to 0 inside the game... Here it would be nice, to display the last maximum reached HiScore... (Would be nice to have this value, even when restarting the exe... So just save the HiScore to a file... Maybe you can even add a HiScore for up to 10 or 20 "Best of players" with Names? ;) However, as long as the game runs, it should not reset the HiScore back to 0 for each new round ;)
- While the game will be played by mouse, it would make sence to start a new round not just only by pressing the spacebar... What about something like: "Press space or left mousebutton to play" ^^
- Fullscreen support would be nice... (maybe even switching between windows and screenmode while playing?)
- 8 bit retro sounds would be probaly very cool too
-
Its indeed a great game. I really like the pixelated style you draw the invaders. Looks
very retro and fits 100% to the game.
I second most of the points va!n already mentioned:
- Retro sound would be really really good
- Fullscreen support would be nice
- In window mode it would be cool if the game recognize when you leave the window with the mouse pointer and automatically pauses the game. When I re-enter the window the spaceships movement seems to be bit laggy/buggy
- Maybe it is because I am just not good enough at the game - but it would be cool if you have something like 3 lives or so...but on the other hand it might be more casual if you only have one life. So I am not sure about this to be honest.
- And I definately second another point va!n does - that switching from keyboard to mouse after you pressed start is not really user friendly.
Nevertheless, this game is really great. It is worth polishing IMHO. Good work!
-
Thanks for the kind words.
- Retro sound would be really really good
Will do. I have thought to some extent how I want to do it-- several channels, one for a bass line, one for a melody line, one for chiptune arpeggiated chords of the kind you hear in keygens, and two for game sounds-- one a squarewave channel for shots and explosions and another for divebomb whistles for the aliens.
How does that sound to you? What would be a good way of handling this, particularly the music? Perhaps procedural music would be a little much to bite off and I should just concentrate on alien whistles, explosions and a bass thump...
- Fullscreen support would be nice
I will look into it but then you have to mess with resolutions, widescreen, letterboxing, et cetera. Ideally the window could just go fullscreen with no titlebar, toggled by "f." Anyone have any idea how to accomplish that?
- In window mode it would be cool if the game recognize when you leave the window with the mouse pointer and automatically pauses the game. When I re-enter the window the spaceships movement seems to be bit laggy/buggy
Agreed.
- Maybe it is because I am just not good enough at the game - but it would be cool if you have something like 3 lives or so...but on the other hand it might be more casual if you only have one life. So I am not sure about this to be honest.
I want the game to be exceedingly difficult. Like Super Crate Box. This is how games used to be! If you want to see difficult, try some Alien Typhoon. I recommend the emulated Apple II version:
http://strategywiki.org/wiki/Galaxian/Home_version_comparisons
It is probably an insincere impulse I'm having (meaning something I think of but will never do) to load up the Apple II emu, load up a disassembler, and study the code for some of those old games to find out how the sound is done among other things. There are probably easier ways of going about learning that (like stabbing myself in the eye with a burning, sharp stick and learning that way...)
- And I definately second another point va!n does - that switching from keyboard to mouse after you pressed start is not really user friendly.
Agreed and easy to fix.
Nevertheless, this game is really great. It is worth polishing IMHO. Good work!
Thanks again and I will put in some more time on it. I think the "procedural critters" thing is the most fruitful part of it and I will very likely expand on that part. Part of my goal here was to produce a harvestable framework-- stuff I can pull out and reuse.
-
Yep, your idea with the sound is interesting. However, I wonder if it might become
too complex. But have a go with it. Personally I would think a nice chippy tune in
the background and some sound effects (also 8bit styled) would be enough.
Toggling fullscreen using "f" key sounds good. No idea how to set fullscree in
Blitz though, sorry.
Keep us informed about your progress!
-
Valis, is the source available somewhere?
Thanks,
Greg
-
Greg, sorry to let you know that Valis deleted all the sources to his posts in a fit of pique when he didn't like some of the advice he was getting, rendering nearly all of the useful topics he was involved in useless.
Having said that, if there's anything in particular about the techniques he used that you want explaining, we can help.
-
Greg, sorry to let you know that Valis deleted all the sources to his posts in a fit of pique when he didn't like some of the advice he was getting, rendering nearly all of the useful topics he was involved in useless.
Having said that, if there's anything in particular about the techniques he used that you want explaining, we can help.
That's a shame :( Just had a look at the game and it looks really nice.
-
Yeah, the game was good. I really like the way that the aliens exploded :)
-
Nothing in particular Shockwave. The explosions were cool and the game loop seemed pretty efficient so I'm more curious than anything else. I always appreciate some of the more creative approaches to common problems. For example when working with databases a common problem might be something like this Name = Fields.[NameField] where NameField is the field name in a database. If NameField is blank or an empty record setting Name = to a Null value can throw an error. If you instead use Name = "" & Fields.[NameField] you proceed the Null with an empty string which avoids the error without error trapping. Simple and elegant. The demands of having to develop fast efficient code for either game loops, animation loops etc. with high FPS is a great way to develop ones skills with more mundane applications. Back in the DOS days I made a simple 3D star field demo with pre-calculated lookup tables etc. To get more speed I did all the calcs with long integers in place of single precision variables imagining where the decimals would be.