Greetings and hello!
I hope this is the appropiate place to post this topic.
I just recently started AGS and for a semi-major first project I wanted to experiment with the powers of this wonderful studio.
The creation is a remake of a 2d scroller demo game called 1945 that comes bundled with Game Maker 5 (http://www.cs.uu.nl/people/markov/gmaker/download.html). When I say remake, it means I grabbed the original idea of 1945 and included it's graphics to simulate it's overall idea in AGS.
Please note that this game is not going to be completed. It is semi-playable and I will write notes about how I conquered different areas of making this game. If you have any criticism or suggestions on better ways to do what I was trying to go for, feel more than free to reply to this topic.
My DEMO version of this game can be downloaded HERE (http://ragnarok.net/xack/games/1942/1942.zip)
get past 8,000 score and i'll call you good lol ;)
(http://ragnarok.net/xack/games/1942/scrnshot.jpg)
Quick Overall Summary:
Time taken to make: ~8 hours
Enemy Planes are Characters: When I read through the limits of 16 objects on a screen at once, I thought perhaps it'd be better to make the enemy planes Characters instead of Objects. Was this smart?
Bullets are Objects: With how the collision code is handled with objects it seemed more appropiate than making bullets a character.
MyPlane is a Character: When you navigate this game, you're really just navigating your character left and right.
Explosions are objects: After looking through the different ways to manage explosions, I found animated objects were ideal.
HERE (http://ragnarok.net/xack/games/1942/1942global.txt) is the global script coding for this game in *.txt format, If you ask below for the actual source code of this game I'll be more than happy to send it to you personally.
If you look up these
AnimateCharacter
AnimateCharacterEx
in the manual, one of its parameters is about whether or not to loop the character animation.
first thing i tried doing was moving the plane with the keyboard then i realized you had to click, that could clear up lots of the movement issues i think, using the keyboard and not the mouse
it would move much smoother too
i also see that the explosions continue as objects that can destroy you. is this cause you're only changing the view number of the plane? i'd probably use objects for the big explosions that can pass right through the ship [unless you want them to be deadly]
then for say smaller explosions just use a one frame RawDrawImage() that gets placed and removed at each hit [like on a larger battleship that takes more than one hit]
planes as characters was definetly a good idea because they have their own baseline that moves with them [correct?] and the collision will work better [from my tests on my zelda game i find this best]
if you still want to keep the moving with the mouse click then make sure you turned off "character turns before walking" and maybe turn off "anti-glide mode" the plane clicks when it moves and i believe this is from antiglide mode
overall nice work, woop woop
eric
[scroll that background dammit! hehe]
sweet, thanks MrCollsal. I needed small notions of inspiration like that 8)
added in keyboard left\right, working on RawDrawImage() for explosions..
Curious... can you scroll a background image? The original 1945 just had a stale background that scrolled down, with islands on it.. AGS I'm guessing can do that somehow.. maybe a quick command hint ?
don't use rawdrawing for animated explosions, i'd recommend objects or even just setting up an int that disables the hit detection for the explosion/plane
scrolling isn't possible unless you make 5 different backgrounds that will act as the animation, so each frame will have moved the water down a few pixels, just make a loop and it should look ok [especially if since the background is tile based]
problems are you can't change the speed of the animation yet unless you used timers and then it'd get choppy
Ahhh, right. I used objects to do the explosions, they work now (just not properly aligned, need to go through and fix that <cough>)..
Also need to fix the background, it still looks horrid. On the bright side, there's now islands that scroll.. Not perfectly, of course lol.
Big thing is it works!
nice
the keyboard movement is kinda wonky, how are you moving it?
i'd suggest something in the rep.execute where if the left key is held down you just add 3 or something to an integer and then set the character's X to that integer
should move smoother
the background gives me the willies i think cause it seems to undulate towards me and then fall back
the islands pop up on top of the planes if they go past the plane's baseline. i wonder how the game would look if you actually moved up along an actual background. wouldn't have to be fast.. and maybe palette effects for the water would work well as in some cycling
see, the more you go into the game the more you'll realize that sure AGS is powerful but damn is it hard to get it to do things like this, like adding shadows will be easy enough but still annoying, the same with more badguys
but rock on with the scripting so far, it's all so tight and well commented [something i need to remember to do, hehe]
I have a recommendation for the code, since as eric says you seem to be trying to make it readable :)
I'd #define all the global ints, sounds, room objects etc in the global script header, as follows
#define GLOBALINT_LIVES 0
#define GLOBALINT_SCORE 1
#define SOUND_EXPLOSION 1
etc
Makes things slightly more self-documenting.
Looks good - nice work!
Steve
Lol, I didn't know you could define the global int. Oh here, I re-updated the txt file with my latest update. (http://ragnarok.net/xack/games/1942/1942global.txt)
You can't make character arrays can you? =(
Also, delay timer example? I couldn't find a good one in the help file.
MrColossal: Would I just assign a globalint that's set whenever you press a button and found in repeat_exe, or is there a way to check keystates while in repeat_exe?
My Direction code is really simple (found in event on_key_press(int keycode)
if (keycode==375){ // left arrow
if (character[ME].x > 20) character[ME].x = character[ME].x-5;
StopMoving(ME);
}
if (keycode==377){ // right arrow
if (character[ME].x < 300) character[ME].x = character[ME].x+5;
StopMoving(ME);
}
Steve: Defining GlobalINTs.. I can't find any area on the helpfile that talks about it. could you give me a quick example on where you would set a #define up (at top of code? in start event?), and how you'd set\retrive data on it? Haven't used C in ages 8)
Thanks for the feedback, Looking into the help file for the pallete cycling tips
Note To make this stupidly hard to beat, the "radars" of the enemy start figuring out where you are by when their allies pass by you and spot you, or you kill an enemy plane!! So watch out, Kamakazi never meant anything worse!
By character array, do you mean what C means, ie, char frobozz[]?
Because you can just use a string in AGS.
As for the global int thing, like I said, put the #defines in the HEADER (go to the Script menu and select "Edit script header... (Ctrl+H)", then type in lines like
#define GLOBALINT_LIVES 0
Then, instead of typing
SetGlobalInt(0, 5);
you type
SetGlobalInt(GLOBALINT_LIVES, 5);
As for delay timers, look up SetTimer() and IsTimerExpired(). They're explained pretty well in there. I haven't used them though, so I can't offer any advice.
Cheers,
Steve
Quote from: SteveMcCrea on Sun 05/10/2003 23:10:18
By character array, do you mean what C means, ie, char frobozz[]?
Because you can just use a string in AGS.
I mean, My enemy planes script names are like.
ENEMYA, ENEMYB, ENEMYC, ENEMYD...
and because of this, I repeat the same code over and over doing if's for each enemy. (Mainly because each character has the same roles in sets of 3's.) ..
My question was more for grabbing perhaps the index value of a character, and setting properties like maybe..
character
.x = ###; //I = incremented value in a for() loop
instead of
character[ENEMYA].x = ###;