Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Newbie in DB! Objective - Galaxians!!??

Author
Message
CaptinScarlet
21
Years of Service
User Offline
Joined: 12th Feb 2003
Location: United Kingdom
Posted: 12th Feb 2003 12:42
Hi all,

This is my first project in Dark Basic having bought it along with the Darkmatters thrown in for free after xmas. I would like to do a Galaxians type 2d game, i have a problem:

1. I think I learn best from examples/reading I have not found much info on the type of game I would like to do, any source/tutorials on this anywhere?? like how do I do the AI for the aliens as they come down the screen?.

Also what's the difference between DB & DBPro and can I upgrade from one to the other cheaply or do i have to buy the whole thing again?.

I come a visual basic & C/C++ (little) background, so i have done some programming, but not much in the games arena, so any help would be great.

Thanks.
Gilfalas
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 12th Feb 2003 13:15
Hi

I am working on 2D shooter too but its concept is quite different from Galaxian. Maybe I can be of some help though.

What I did, was design arrays to store the infos about my aliens in. Such as current position, if it is still alive or already destroyed, but also what kind of movement it will use when coming down the screen.

This is what you might want think about: How should the movement of my aliens look like? Then you could design functions that will change your alien's current position according to the way you want it to move. You could for example use a simple function that makes your alien come down the screen straight. Or flying left and right when coming down.

For example, you check your alien's info in your array and then use the proper function to move it. Do this for every alien and you get different movement for different aliens. You could also update the info in your array to make the aline move differently at every wave.

Hope this help.

If you have more specific questions, especially if you don't understand my bad english, you're welcome

CaptinScarlet
21
Years of Service
User Offline
Joined: 12th Feb 2003
Location: United Kingdom
Posted: 14th Feb 2003 16:42
Thanks for your reply Gilfalas,

I mainly would like some example code of Alien AI and Alien to player collosion detection, any code / help would be great, Im using Dark Basic V1.13
Gilfalas
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 15th Feb 2003 15:38
Hmmm... the trick I used was to use 3D objects, but placed my camera in such a way that you get a top view of the scene. This way it looks like 2D, but you don't have to draw sprites for everything. Like, for example, when you fly left and right, your spaceship has to tilt to the left and right. If you use 3D objects, you don't need to draw the image of a tilted spaceship. Just rotate the spaceship and it looks perfect even if you can't draw crap...like myself.

Collision control shouldn't be a problem when using the collision control commands in DB. Just have a look at those commands. They are pretty straight forward. Maybe if you ask more specific questions or explain where your trouble with collision control lies, I might be able to give more precise answers.

For the Alien AI, you might want to explain what you want your aliens to do. My aliens, for example, will attack you flying straight at you, or fly from top to bottom of the screen swaying left an right etc... If you tell us what you want them to do we might be of more assistance.

Gilfalas
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 15th Feb 2003 16:25
BTW: Don't go arround asking for code... people will most probably ignore you if you do. Why? Because it's like telling us: "I am too lazy to do the work myself, so I am asking you do to it in my place. But I'll be more than happy to copy/paste your code into mine." Even if this wasn't your goal, which I believe myself, that's what it looks like.

It's an unwritten rule that you don't simply ask for code. If you ask specific questions, proving that you have already put some thought and work into the subject yourself, people will gladly help.

So if you tell me how far you are into developping your game, and where your specific problems lie, I will gladly help you work out the mechanics behind this kind of game. You'll learn more this way, than simply copying code.
The best piece of code will teach you nothing, if you do not know what it is supposed to do and how it works.

I'll try to answer your questions the best I can.

CaptinScarlet
21
Years of Service
User Offline
Joined: 12th Feb 2003
Location: United Kingdom
Posted: 18th Feb 2003 19:47
Thanks Gilfalas

My main problem right now is with "X files"!! how does this work?(I have never done 3d before) , I would like to do this game in 3d as you mentioned so i'm looking at one of the demo games in DB called "Swarm" which is a 3d space invaders clone, don't understand how players ship is created with "ship.x" file tring to find some decent tutorials on this. as for AI, alien ships attack player top down in random attacking sine wave formation like in galaxians. I have written a similar game in C a long time ago, so i suppose can dig up source and look at the AI again (at my Horror!).
QuothTheRaven
22
Years of Service
User Offline
Joined: 2nd Oct 2002
Location: United States
Posted: 18th Feb 2003 19:59
galaxian was already made in dark basic, its in the help files

Dark Basic/myproj/swarm/swarm.dba

there you have it, galaxian. Steal what you need to, but all the code for a good ol' galaxian game is riiiight there
CaptinScarlet
21
Years of Service
User Offline
Joined: 12th Feb 2003
Location: United Kingdom
Posted: 18th Feb 2003 20:26
Urm Swarm is not galaxian it's more like space invaders, alien movement left-to-right then down a row etc, etc.
Gilfalas
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 19th Feb 2003 12:26
hmm ... I am not sure if I understand your problem with .x files. I'll try with a general answer: Most people will use a software like Milkshape 3D to create their models. This software lets you create 3D models and then it will save them in a format supported by DB. Once created you only need to load them into DB.

Yeah, your AI should be pretty easy to do. One of the movement patterns for my aliens is also a simple sine wave. The way I did it was simply decrement my z position (so they move from top to bottom) and add an offset to my x position. This offset is calculated through a simple sin(wrapvalue(a))*b
Where a is my ship's z posizion and b is a multiplier so you can control how much your aliens will sway left and right when flying down.

Hope this helps

btw: I wouldn't bother too much using accurate objects in the beginning. You'll spend too much time creating your models and not get any coding done. I would use simple objects first. The kind you can create with DB like cubes, spheres first, and then when your code works only rewrite the part that loads/creates the objects you need.
My code is completely independent of what models I want to use. My levels are defined by data that is contained in a file (one file per level) and I can define the models I want to use in that file. So if needed I could use any models available.

CaptinScarlet
21
Years of Service
User Offline
Joined: 12th Feb 2003
Location: United Kingdom
Posted: 19th Feb 2003 20:49
Thanks again Gilfalas!!

I have downloaded Milkshape yesterday and will try & get to grips with it later. I will take your advice in using basic objects until code is ok. I was studying the swarm tutorial code within DB as a way of learning how to do certain things and I will write my Galaxian clone from scratch. Thanks for explaning the AI bit which i will now attempt. Must rest my eyes now before they fall out from amount of reading I have done today!!, Thanks again.........until later

Login to post a reply

Server time is: 2024-11-24 04:08:47
Your offset time is: 2024-11-24 04:08:47