Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - HAL

#1
Made another game... and it's not an adventure game!

Space Bird Missile Cats

Defend the universe from the never-ending horde of space cats and their evil, deadly weapons!

Who can get the highest score...?  :wink:







Let me know if the download link doesn't work.
As with my previous game, I'm still in China so might have had upload problems.
I managed to get it into MegaUpload, but I've never used that website before so I don't know if I've found the correct link for file sharing.

DOWNLOAD

It's been another 'quick' one, bit of a training thing. Only took 5 days and I learned/practised a fair few programming techniques  :smiley:
Spoiler
Yes I know the high score table could have been placed into a single .dat file but it was a learn-as-you-go thing and I really didn't want to destroy my code by going back to try and fix it. So I apologise in advance for the 20 separate high score files you'll see in the game folder...
[close]

I think this'll be my last for a while. If I make another, it'll be a proper attempt at something big and bold.

Enjoy!
#2
I'm making an arcade-style game with AGS.

I have a high score table and it works.

However it took a huge amount of code and I'm certain there must be an easier way to do it.

It's a 'top ten' thing and it saves the scores so that when you reopen the game they're still there.
Hence I used arrays to hold and distribute the scores.

However I then found that I couldn't read file data back into the arrays.
I was fine writing the arrays to the file, but I couldn't read them back out again.
So I had to change it, so each score is sent to its own file and then retrieved individually like this:

Code: ags

function Get_Scores() // This function reads the scores from file then distributes them to array elements accordingly.
{
  File *HighScore1 = File.Open("HighScore1.dat",eFileRead);
  scores[0] = HighScore1.ReadInt();
  HighScore1.Close();
  File *HighScore1name = File.Open("HighScore1name.dat",eFileRead);
  names[0] = HighScore1name.ReadStringBack();
  HighScore1name.Close();
  
  File *HighScore2 = File.Open("HighScore2.dat",eFileRead);
  scores[1] = HighScore2.ReadInt();
  HighScore2.Close();
  File *HighScore2name = File.Open("HighScore2name.dat",eFileRead);
  names[1] = HighScore2name.ReadStringBack();
  HighScore2name.Close();
  
// etc etc etc up to 'HighScore10'



As you can see, I needed a separate section of script for every single value of 'name' and 'score'. So 10 chunks in total.

In the manual and in forum searches I couldn't find anything.
The manual says 'ReadInt' is for reading a single integer back into place, and 'ReadStringBack' is for reading a single string back in. No mention of reading array values from a file.

Did I miss something, or do something wrong, or is my long solution the only way?

Thanks. :smiley:
#3
First game finished!

UPDATE UPDATE: Game file is now hosted on DropBox, instead of the Chinese server I was using before. It should now be accessible to all.

UPDATE:
Gave the game an opening menu so it doesn't just dive straight into the first level.
Also added a map to the inventory which charts progress. Gives it more of a 'travelling China' feel.
Changed the main character sprite so it isn't the default Roger.
Increased dialogue font size so it's easier to read.


First, a bit of an introduction: I'm in China for a year, studying here. Having just finished my first semester and with two months winter holiday ahead, I completed a bit of travelling and then returned to campus still with plenty of time to spare, so decided to have a look online for 'old games', at which point I stumbled across AGS and was immediately absorbed, and got to work on making a game based (very, very loosely) on my recent trip. I've spent an average of 12 hours a day continuously making this game for the past two weeks, and I must say it's been quite fun, although I don't think I'll be returning to such a routine any time soon!

The game fits firmly into the category of 'training game', but I must say it was one hell of a dose of 'training'.
Also it's fairly large. It'll take a good couple of hours to complete. Maybe a lot longer.

- Join Chongo on his absurd adventure across China, from the central-southern city of Chengdu to the freezing northern tip of Harbin, with many more epic locations in-between.
- 61 photo-realistic locations all over China
- 16 inventory items
- A final 'boss' the likes of which I'm certain none of you will have ever experienced before.













Downsides:
- Uses royalty free music I found online so you may have heard the soundtrack before
- It plays in full screen but the image is a smallish box at the centre and I can't get the picture to scale up. Maybe others know how to do it, but I can't on my computer and I've tried everything. However it's 640x480 so still perfectly playable.


DOWNLOAD HERE


A disclaimer:
Spoiler
DISCLAIMER  - The final boss level is NOT a political statement. The game was a whirlwind of random creation, literally making it up as I went along. The final level just 'happened' and is supposed to be as comically absurd as the rest of the story. I doubt anyone cares anyway but I just thought I'd cover my back in cases someone decides to get touchy about it.
[close]

Comments and criticisms are welcome.

Overall I'd like to say I'm quite chuffed with the result for only 2 weeks' work :smiley:
#4
Here's my code.

Code: ags


  int i = 0;
  float yy1 = 0.0;
  float xx1 = 0.0;

  while(i<451)
    {
    xx1 = IntToFloat(i);
    yy1 = -(((4.0/2025.0)*xx1)*(xx1-450.0));
       
    oBird1.Move(81+i,367+FloatToInt(yy1, eRoundNearest), 6, eBlock, eAnywhere);
    Wait(1);
    i++;
    }


This should generate a parabolic flight path of an upside down U-shape, moving from left to right, 450 pixels across the screen. (Assuming my maths is correct. Either way, it should generate a path of some sort).

It totally doesn't though. The bird blips a little, the loop then runs to the end with no movement, then when it's done the bird moves horizontally across the screen in one smooth final move to its end co-ordinate.

I'm trying all the techniques from the similar thread I made just yesterday, but always failing.

Have I missed something? :confused:

Thanks.
#5
I'm having a go at learning to animate things using parametric functions of x and y, using trigonometric functions to gain smooth curves of movement.

I'm having problems all over the place, saying it either 'cannot convert Int to Float', or 'cannot convert Float to Int'.

I've tried all sorts of variations of Ints and Floats, but nothing works.

The key issue seems to be that the Sin and Cos functions need to take float values, but I then need to bring my results back to being Int values for the co-ordinates in the Move function.

As far as I can tell, my code should get around all this. But I guess I've gone wrong somewhere.

This current coding setup is failing on line 2, saying it can't convert Int to Float.
But why does it even think 'k' is an Int in the first place? :confused:
If I change 'k' to Int, it just pushes the problem further down to lines 8 and 9.
Mega confused here :undecided:

Code: ags

   int i = 0;
   float k = 0;
   float x1;
   float y1;
   
   while(i<100)
    {
     x1 = 40*Maths.Sin(k);
     y1 = 40*Maths.Cos(k);
     
     oBird.SetPosition(555+FloatToInt(x1, eRoundNearest), 489+FloatToInt(y1, eRoundNearest));
     k = k+1;
     i = i+1;
    }


If I remember correctly, this code should only result in the bird oscillating diagonally over a straight line anyway, which is a little pointless, however if I can get to grips with this then I can start playing around with more complex trig functions to move things in spirals etc.

Thanks for any help. :smiley:
#6
Hello, first post, new user, just started using AGS and christ almighty I do believe I've found myself a new ultra awesome hobby for rainy days.

Just a quick question:

I'm making a bit of a game and some of it is fairly generic as I'm new to all this, so to try to add at least a bit of variety I want to change the colour scheme of the default character sprite. I know it's not much but then it's at least slightly 'my own'.

From the sprites folder I see I can 'Export all sprites in folder'.

I choose this option and it gives me all the sprites, at 18x40 resolution, in the designated folder.

I then spent ages changing the colouring of them all, and imported them all back in only to find they're now far too small. My character is now a midget.

What do? :confused:

Ok I guess I could just scale up every sprite in MS paint or photoshop or whatever. But I just think it's a bit weird. I have the fully functional default character sprites, which I export to my computer, and then when I export the very same sprites, simply with a new colour scheme, with the very same resolution they came out at, they come back too small!

Is there something I've missed somewhere? Or is there an easy way I can get around this?

What's the default resolution of the in-game character sprite? It exports at 18x40 but that's too small when I import it back.

Thanks all.

I should have a fully finished game in the next week or so, which I'll be sure to share.
SMF spam blocked by CleanTalk