Simple games in C?
I'm half way through Anders Bjerin's excellent book Amiga C Manual, with its many useful examples of C codes.
Does anybody know a source of simple games written in C for the amiga that I could study next? Thanks. |
Yes, you can try my games
MazezaM - http://aminet.net/package/game/think/MazezaM Alex in Town - http://aminet.net/package/game/jump/AlexInTown And some other of which names I have forgotten over the years. |
These are great thanks.
They are probably a bit too complicated for me to understand at the moment., but there's plenty here for me to get my head around. It's a lot easier to learn by picking games apart. |
|
These are fantastic thanks.
I probably need something more basic at the moment. There seems to be a massive leap between reading the theory of C in a book and actually coding games with it. |
Out of curiosity, what compiler does the 'Amiga C Manual' use / recommend?
|
The Amiga C Manual uses SAS C Lattice. The book is available in Aminet.
The book is excellent, with loads of examples. I love the fact i can copy the examples into Notepad++, and load them into Winuae. Saves a lot of typing. All the examples in the book have been printed from actual code, so no typos wrecking things. |
Thanks Ami.
Yes these web pages looks perfect. This will take quite a while to study. It looks like a good intermediate step. I like the way the files are provided at the end of the game example. I shall start studying this when I finish all the examples in the Amiga C Manual. Thanks a lot. |
Quote:
nice! i'll grab a copy of it. i've been working on a cross platform database app (just for fun, mostly to play with the various idiosyncrasies of various c flavors) and have it working on sas/c on the amiga, borland on the pc, and think c on the mac (and gcc on the modern). So far, sas/c seems like it's the 'least picky' of the compilers I've used. if you're just learning, my (unsolicited) advice is to actually type the code in. in my experience, it's a much better way of learning. for one thing, you'll invariably make mistakes and typos, and a big part of development is learning how to figure out what those mistakes are and where you've made them. |
The first level of the game Menace has been coded in C,worth a look once you
have a bit more experience. http://amiga.filfre.net/?page_id=17 |
Thanks for the advice OmegaMax, the Menace code is a good suggestion. Definitely what I want to aspire to.
Abub is right I must ultimately be typing the code myself. I just found when I was learning Basic that it's good to take existing code and tinker with it to see what works and what doesn't. What I'm finding about C is that it seems to be all about building up a structure that will work. Less concerned with understanding the individual nuts and bolts. If it wasn't I would have to understand the detailed workings of the include files? I hope I'm right here, but feel free to disagree. If anyone else has Simple Games in C to recommend please do. I'll need all I can get! |
Writing code and playing around with another programmers code is a good way to learn.Learning structs is an absolute must for game programming in C(Make sure you really spend some time learning with structs Toki),this isn't for amiga but it's a good example of playing with another programmers code an observe the changes to understand.This one is quite simple but if you already understand structs ignore my post.
Code:
https://i.postimg.cc/C56mDzcW/Untitled.png Code:
//Same exact code but increase MaxNumberOfBaldies |
I love it, that's a lot of Baldies. Great pictures.
The trill of being able to program the Amiga to do things is a revelation. I shall study structs. It's great to study something then immediately be able to put it into action. I suppose I'm not surprised that more Amiga fans don't code. Now seems like the best time more than ever. The amiga fans seem to be encouraging each other to step into the world of coding. Surely this was the dream of the software engineers such as RJ Mical that the amiga would be used to turn us all into coders. |
Code:
#define MaxNumberOfBaldies 30 ;<-- Max amount of baldies The code you quoted cannot just compile because of the macro expanding the colon inside the array size declaration. In that case, even using // would make the compiler fail. Comment above the line if you must. be careful of macros. And yes, SDL is excellent to learn about coding games, but not on amiga, SDL is just too slow to be useable. |
I've never seen semicolons used for comments. Which compiler accepts that?
|
Sorry,I didn't mean to cause any confusion with the ;comments and I just assumed majority would know how to comment in C,bad assumption on my part.
|
Quote:
I asked my question politely, there was no reason for such a rude response. |
I wasn't being rude,and it is my fault, it didn't dawn on me that anyone would try and compile what I posted.I also assumed every programmer would know to use //../* */ and not ;.....Sorry if my post came off as rude as that wasn't my intention.
|
Wow, what a debate over a single symbol.
If you can't notice the symbol, your code won't compile, so you will need to watch closely and get more experience, eventually finding other bugs in the source. For the record, old Amiga C compilers won't compile with // either. This is a C++ standard. VBCC has the option -cpp-comments - Allow C++ style comments (not ISO89 conforming). What's next? Which is more correct - Tab or Spaces? |
All times are GMT +2. The time now is 05:35. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.