Discussion in 'Games' started by Aleksander, Oct 10, 2011.
still no autofire?
I wont program it, until it is a "real" game with 3 levels.
So, don't get angry with me, but the problem is that i don't know how to do it
(will probably find a way for it )
I did a simple calculation, of what is the minimum spec for the game till now.
My PC has a ~3.1Ghz processor (with 4 cores) and the game uses up to 2%
If 3.1 is 100% what is 2%? 0.062 Ghz or ~60Mhz
Is this for nintendo?
Maybe if i add sound, the game will need much more resources, will see...
Some suggestions for you from a programmer:
I did a game last year, similar, anyway, hit detection, needs improvement. That is the TOUGHEST part IMO. Seems you only have a "line" of hit detection, like when player, which we will call P, is equal to the enemy (e), then detect hit, IE:
if ((px = ex) && (py = pe)) then
That would be my guess, you detect x and y, but you need a little tolerance around it. So assuming that the origin of the enemy is in the bottom right, you can say like if abs(px - ex) = 10 then blah blah blah. Therefore you extend the hit range. You will have to do this for both character and enemy.
Also, the blue enemy made me lose multiple lives, but that can be modifed with hit detection. ALSO: make is so we can shoot slower!. Also a rolling background would be niec, like a GIF of space going by or something.
if ((px = ex) && (py = pe)) then
Ok, thanks for the reply professional
First of all, i don't get the "line" of hit detection.
You mean only a line of code? Or a line which it gets detected?
If you want a hit detection between the player and the enemy, i simply think that is a bit stupid.
(at least for me)
The idea is that if the enemy passes off the screen, you lose a point.
The other kind of enemy, moves faster and makes you lose more points.
Again, what i got from your hit detection, is that if the spaceship gets "crashed" with the alien
it loses 3 points. (with the square alien i mean)
The slower shooting is not a prob, you know.
I don't know how to move a background in allegro, because i am learning new thing every day!
Last but not least, the algorithm for the detection is ready, i am serious.
I just think that it is stupid and wanted to add something new to this kind of game and set it as a comment for later.
Also, i made 4 for both aliens x and y and ships x and y lines of code about the detection and is really tough i know.
(needs math logic)
Due to the TPUgiveaway competition last month, I set various tweaks in my gpu control panel, incl. forced sync to screen refresh rate which on my TFT is 60Hz. However, I think you game is also forcing a 80fps sync, and there was a conflict between my TFT driver based sync refresh at 60fps and your software synced refresh. The poor PC was working "In the interference gap between the two conflicting sync refreshes".
I've reset my gpu drivers.
I am now on 80fps and 5-12% utilisation on a P4. So all is fine. Tip: I wouldnt use a forced fps sync in your game. You need to link the speed of the aliens, ie your main engine, to a CLOCK rather than to a software loop and then artificially slow down the loop using a wait-to-sync to 80fps.
Alek, Are you using sprites in your game, or are you using line/box draw routines? Have you looked at some of the code of other arcade games at allegro.cc? Do you have any books to help you with games and allegro, e.g. http://www.amazon.co.uk/Game-Progra...3834/ref=sr_1_6?ie=UTF8&qid=1318549780&sr=8-6
You first game is coming on fine... just make sure you get some tips from other people who have posted their source code on allegro, or from a book that will tell you about event handling that might help you with the main engine.
Looking forward to next version!
I will try to change the forced sync after a learn more and will tell you.
Normally, i said in another post, the ship is with 3 boxes, so all things you see are simple box draw
routines. I have seen a lot of games and of course that nice book. The only problem with both is
that none has allegro 5.0.4, the one i am using and that is the latest. The book uses the old 4.0 and
the games use that old one too. Will try to add the new version as fast as possible, although it will require much more work than the other versions.
Yes, I think Allegro is designed for using sprites. I think the draw boxes (and alien circles) are not going to be as efficient just due to the way they are "calculated and drawn each time" rather than "just placed" if they were sprites. There is a lot of real-time calculation dealing with drawing whereas sprites have very fast bitmap algorithms.
Although A5 and A4 are quite different, don't be put off by looking at A4 source-code. When learning a new language, actually the exercise of TRANSLATING one language to another language is a great way to learn. Take a look at some of those gaming routines published in A4 and convert them to A5. I really believe that it will be a useful and educational exercise.
I do agree though that a games book specifically targeted to A5 would be the greatest help for you at this moment... but I think an A4 book is better than nothing. Although the language has changed a little, the concepts and algorithms are the same, and the explanations could help you get 80% there with A5. Actually, this is a better way of learning than just copy+paste code directly out of an A5 source!
Nintendo NES lol
Maybe, in my case my netbook is a Atom N455 working @ 1GHz (battery mode), 1GB RAM DDR3 at 300MHz I think, and an intel GMA 3150 GPU, and it works super smooth using 9% CPU, so your game doesn't need many resources, maybe only a 3D capable video card and 500+ MHz CPU. Sound wouldn't consume much as far I know
Am trying to learn as much as possible, even though there is no way i can learn the allegro5 with books there are some guys who made videos(a lot of crappy videos though)
So a book would be awesome, it has its advantages over a video tutorial.
After all the video is based on the book
There is a manual for allegro 5.0.4 from allegro site and i am based a lot in that for now.
It would be perfect to program games for mobile phones, cuz as i see, the iphone is part of allegro manual. Also, there should be a lot to learn and optimize cpu usage.
Unfortunately, this time the update of the game will be quite a bit longer than before...
Separate names with a comma.