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.

DarkBASIC Discussion / DNG - Space Invaders

Author
Message
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Sep 2010 09:25
If you need anything, I will have a few days with nothing else to do, so I can whip up some last minute code (I've done most of the project on my own already anyway) or help with compiling.

Just let me know.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 17th Sep 2010 21:29 Edited at: 17th Sep 2010 21:31
I haven't abandoned this, I'm going through the code as we speak. I found something I'd like to point out.

This code is inefficient, can you tell why?

The inefficiency is because of these lines

We are manually setting the screen resolution and then use a function to read the resolution back to us! A more efficient method:

This also reads better as now we have actual values for scrw and scrh instead of function calls which don't mean anything to the reader unless they already know what the screen resolution is.

This example doesn't really need to be efficient because it's run before the main loop, but it's good practice to keep all your code efficient so you can get more out of your programs.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 19th Sep 2010 02:53
Please post if you want something to do. I'm having trouble going through all this code without being able to test it so it's taking a while.

AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 19th Sep 2010 02:59 Edited at: 19th Sep 2010 03:01
I will do anything.

but seriously whats left to do in the game rather then just put it all together?

Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 19th Sep 2010 04:38
yeah, I can't really help much right now unless you really need me. I don't have internet on my dbpro computer right now.

No hurry Obese. You have a hard project to do.

yrotate when you can spin?
God Bless!
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 21st Sep 2010 04:29 Edited at: 25th Sep 2010 03:04
So can we call this project officially canned?

If everyone is gone i'm still gonna try and finish it

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Oct 2010 02:20
I have been watching this thread for a while. It seems that quite a bit of work has gone into this game, but I don't see the finished product. Is anyone working to finish this up? I expect that some coding knowledge has been gained through the process, but it would be a shame to see it die like so many other games do, and never get completed.

I'm not really a programmer.....I only play one on TGC.
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 2nd Oct 2010 05:34
I have put it to one side because I've had more important things to deal with lately, I hope I get enough time to get it finished. I will get this game finished, it wont die. Thanks for the continued interest. I must get on a machine with DB or this will take me forever.

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 2nd Oct 2010 16:09
Good to hear. Good luck with it.

I'm not really a programmer.....I only play one on TGC.
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 2nd Oct 2010 18:17
yeah, hope it goes well, Obese. We're counting on you

yrotate when you can spin?
God Bless!
old_School
14
Years of Service
User Offline
Joined: 29th Aug 2009
Location:
Posted: 5th Oct 2010 02:58 Edited at: 5th Oct 2010 03:02
Hi guys just seen your post. Im still waiting on my DBPro package to come in the mail but it suppose to come with dark voices. Plus I have tons of sound files etc if you need them. Plus me and my dad write music time to time. If you need a sound guy I can help. I also have a website. Generaly produces about 100 or more bucks a month in rev.

Focussed on UO shard right now. But Im wanting to get back into game creation. Also have Realm Crafter if you guys wanted to work on another game type after or FPSC I have version 9 with almost all Model packs.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 5th Oct 2010 03:10
@Obese
Does anything have yet to be programmed? I have a little time every day that I can devote to the cause. Also I can help with compiling. Just tell me what needs doing.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 6th Oct 2010 10:48
@BN2
I am looking for a house so I wont have much time to spend on this. I will post up what I have done with the code so far. It's not a lot, mainly cleaning up.

Code:


Things we still to do:
The menu needs to be redone, it is incomplete and I don't like the way Eminent was doing it anyway. I would like it to be more modular so that the menus are drawn using functions so there's less code and pausing can't trap the program in a small loop.
There's no level structure, basically there is no game but pieces that need to be stitched together.
A high score table would be nice, but this isn't as important as the other two things.

I can't think of anything else so anything you can manage on those would be great. Anyone else around to help out?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 6th Oct 2010 19:48
Alright, I will get on some of that stuff.

If there is anyone out there still following this, voice your existence now so that I know who is available to help.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 6th Oct 2010 20:40
Yes sir, I'm following every post. I have my dbpro on a computer without internet, but I could still get something done.

yrotate when you can spin?
God Bless!
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 6th Oct 2010 23:59
I am here to help every weekend.

Just give me the word

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Oct 2010 01:05
Excellent. So I foresee these things being needed based on Obese's to-do list:

1)Menu System (Main, Pause, and Options specifically)

2)Level Creation System (nothing fancy just needs to be easy to use so that we can create groups of enemies). NOTE: This does not rule out procedural generation if you want to try your hand at that (I wouldn't suggest it but if you have a concept run it by me first before going gung ho on it).

3)External file framework. Basically it handles storing data outside of the program for loading. This includes: Save Data, High Scores, Key Binds (hardcoded at first but opens up possibilities to allow the user to change what buttons do what). This would look like a series of functions that will read the appropriate file, extract the data, and store the data in arrays/variables.

If you guys want any particular part here, let me know. If you have no preference, just say so so that I know you know what needs doing and I can just delegate them out.

One more thing, once you get your assignment do a quick post here to explain how you will approach it, forseen challenges, etc etc. Basically analyze it and post your analysis here (it doesn't have to be long or complex, just something to give insight to your thought process as you begin). This helps in several ways. 1) It forces YOU to put your thoughts into words which can then help you code much easier the first time through 2) It helps you realize what could go wrong so that if/when it does, you are ready and have already been considering different ways to do it 3) It lets me know what you are going to do so that if you go in the wrong direction I can point you in the right one without you wasting time and having to re-write code.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 7th Oct 2010 01:12 Edited at: 7th Oct 2010 01:14
May I do the level creation?

But I have one question, do you just want the aliens set up in different order, or the barriers too?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Oct 2010 02:38
Absolutely.

I would say keep the barriers constant. If you feel so inclined, you can make it support the addition of barriers LATER (build the support into the structure of things but don't keep a way to manipulate the data).

So for level creation, here is the breakdown:

You want a simple program that will let you create the alien block and save it. The file can be done however you want (Easiest is SAVE ARRAY but most user friendly would probably just be a text file). Loading a pre-made one would be a good feature so that you can edit files. Finally you will want a function/subroutine that handles the loading of all the levels into the main program (we will put that into the main program).

Make sense?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 7th Oct 2010 05:54
I'd prefer the Menu System. If not before, I could probably get it done during the weekend.

I'll probably approach it, by reviewing what Obese has said about it in the previous posts for starters.

yrotate when you can spin?
God Bless!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 7th Oct 2010 18:36 Edited at: 8th Oct 2010 01:50
Alright good start, I will come back later with what it should have in it.

Right now I see the need for 3 menus

1)Main Menu-Shows at the start
2)Pause Menu-when the player pauses the game this shows up
3)Options Menu-Have some graphics settings like gamma and such here.

I will begin working on file system stuff.

@AJ
For the saving of enemy groups, use the SAVE ARRAY command. Use the array:
DIM EnemyData(30,20)

The first argument is the column that the alien exists in and the second is the row that it exists in. Set the value to: 0=Dead 1=First Alien Type 2=Second Alien Type and 3=Third Alien Type

I will be using this for Loading the group information into the program itself. For your files format the naming like this:

XXYY

Where XX represents a TWO DIGIT level number and YY represents a TWO DIGIT enemy group number. So Level 01 could contain 05 enemy groups if necessary. Note the use of 0's. If you keep it as 2 digits, it will make the code to interpret it much much easier.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 8th Oct 2010 02:57
BN2,
Have you done anything yet? Do you want to divide the code up into chunks and take a bit each?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 8th Oct 2010 03:03
I've started working on some preliminary work for the file access stuff and the high score things.

The tasks seemed almost too small to reasonably subdivide without stepping on each other's toes, though if you see differently the plan can be revised. My approach here was to have them explain how they were going to attack the challenge on here FIRST so that we could set them in the right direction first.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 9th Oct 2010 00:27
Okay, I will do a bit more tidying up of the code.

old_School
14
Years of Service
User Offline
Joined: 29th Aug 2009
Location:
Posted: 9th Oct 2010 20:11
Hey guys I can make some concept art if you want for the menu or splash screen etc. Maybe even come up with a mock map or something. Just let me know Id love to help. Send me a PM.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Oct 2010 02:41
@Old school:
Will keep that in mind, thanks for the offer.

@Aj and Daygamer:
Just curious as to where things are at. How is the code coming?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 11th Oct 2010 05:13 Edited at: 11th Oct 2010 05:15
Hey BN2,

Menu code is looking good. Only one issue. I've never messed around with gamma settings so I didn't know how to put that in the options menu.

I'm sure you'll find a few things, so please let me know. thanks



I put a dash of eye candy to the mouse over function. Enjoyed playing with that

yrotate when you can spin?
God Bless!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Oct 2010 08:26
Well when run, it looks good.

Few things here:

First off (this was the reason I wanted you to run things by me first) your approach here:

Remember, this is going to be a subroutine called until the game activates. Given our current code, instead of going to a subroutine that will house the game, just set the variable game=1

You have 3 do loops in your program. Remember: you should only have 1 loop. Anything more than that and you can be doing it more efficiently. Specifically, the benefit is that we can swap between them whenever we want.

So your code should flow like this:



Gamma is essentially screen brightness. You will need a slider. If you can't figure it out, that's fine.

For display mode, its decent how it is. Food for thought: what if you put one there that the computer didn't support? Solution: Use the PERFORM CHECKLIST FOR DISPLAY MODES command. Then you would want a drop down menu of all available ones (or black out ones that AREN'T available)

Other than that, your code is looking alright. It could definitely stand to be commented more, but this was an impromptu check in so I will let it slide, for now. It is a good habit to get in to comment as you go.

Good start, it shouldn't take you too long to fix it up

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 12th Oct 2010 03:13 Edited at: 12th Oct 2010 04:06
Sorry for the double post, but I just tried to compile the program and found these errors. Please make changes:

We need an ENDIF at line 270
Menu: needs a return at the end
The REPEAT command in Pause: needs a condition, as it stands, it just says UNTIL

Granted a lot of this will be replaced soon, but it would be best to keep it up to date until Daygamer is finished.


@AJ
Please put a ,0 at the end of your INK commands. My compiler won't accept it. Not sure why yours does, but put it in there to keep it running smoothly on all systems.
So instead of
INK RGB(255,255,255)
it should read
INK RGB(255,255,255),0


Update for DayGamer:
The infrastructure is almost ready for custom keybind control (so you can change which buttons do what). Don't worry about the menu for it (I will take care of that), just add a button and an empty subroutine into your code.


@Aj
Your Code doesn't work.

Enemy Creation needs to be called only once, but fails since sprite 1 hasn't been created. I created it and built code to only run the subroutine once.

Enemyprops doesn't seem to work at all. The enemies will flash and then disappear at best. The images it seems to use is wrong (set the variable to img_inv which is 2). I tried debugging it but so far I have been unable to make it work. Please fix it. Use the code from the build of code that Obese posted up a few posts.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 12th Oct 2010 04:20
Sorry for the triple post, but Obese, is there a missing subroutine here? There is no code to initiate a sprite (which is cloned and fails because the initial sprite doesn't exist), no code to display the player, no code to display the players shots, etc.

If its all here, then

Daygamer, review your control_player subroutine and your Update_bullets subroutine. Make it display the sprites and make sure it works.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Oct 2010 05:16
Quote: "Sorry for the triple post, but Obese, is there a missing subroutine here? There is no code to initiate a sprite (which is cloned and fails because the initial sprite doesn't exist), no code to display the player, no code to display the players shots, etc."

I'll have a look, I might have taken something out and not finished replacing it.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Oct 2010 07:17
Like BN2 suggested, please post how you are planning to tackle a task before you write any code; then we can talk through any changes that need to be made and you wont waste time writing bad code. Unfortunately I've had to chop quite a lot of dead code out of the program. I apologise for not thinking of this sooner, it would have solved a lot of the simple mistakes.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Oct 2010 10:16 Edited at: 12th Oct 2010 10:41
@AJ
Just going over some of your code.
Quote: "
`checks to see if aliens have reached the right side of the screen
if sprite x(totalaliens)>=ScrW-Sprite width(totalaliens) and enemydir=1
inc alienspeed,4
flag=1
enemydir=-1
endif

`checks to see if aliens have reached the left side of the screen
if sprite x(2)<=0+sprite width(enemy) and enemydir=-1
inc alienspeed,4
flag=1
enemydir=1
endif
"

I've added in some new variables that I use below so check the updated program code if you're unsure what they are used for.

Swarm Positioning
The swarm moves as one, so you don't need to check the position of every alien and use temporary variables. Every alien is simply offset from swarmx and swarmy.

I don't like the idea of reading sprite positions to position sprites. It may seem logical and easier to use these values but it is best to use variables and arrays to control the inner workings and place the sprites on top. What if we decided we didn't want to use sprites any more? What if one of the sprites got deleted by accident? We should not build our foundations on such flimsy things as sprites.

Swarm Speed & Direction
These can be condensed into one variable. What is speed and direction? Velocity! Yes I have made a swarmvel variable: negative numbers show the swarm is moving left, while positive numbers show it is moving right.
When we hit the side and need to change direction we simply multiply swarmvel by -1.

Boundary Checking
The highest numbered alien is not always going to be the furthest right, likewise for the lowest alien and left. * A solution could be to store the number of surviving aliens in each column, then a simple check for the first column with >0 aliens is all that's required.


Don't feel bad that I have made changes to your code, it is my fault for not being more involved, and remember the point of this is to learn not to write faultless code first time.

Here is the full code so far everyone.

I have done more writing than I wanted but that's because I feel bad for cutting out so much! You have all given a lot of time to this and most of the mistakes you made would not have been made if I had managed you all better.

There are a few comments that say "!!NEEDS WRITING!!" on bits that need rewriting, I have usually given some pointers underneath so if you want a go at some odd jobs there's a few things in there, and of course ask if you need any more help. You don't have to explain how you're going to do those tasks because I've explained what I want you to do in the comments.

Everyone please read the header, I've expanded it to act as a sort of noticeboard that I post stuff on for you guys to see. The problem with the forum is stuff gets lost under piles of posts.

Eminent, I'm really sorry I deleted all your code because it had too many problems with it. I think this is my fault because I basically just said "MAKE ME A MENU!!! PLS?" so if you come back I will give you more help with whatever task you pick up.

@All
As a final thought, I have already said I felt bad about deleting a lot of your code, but you will have to be prepared to destroy your own code, even if you've spent a long time working on it sometimes it just doesn't work. You will experience this a lot while you are learning the basics and finding new and better ways to do things. It's not a bad thing and it doesn't mean you suck. Everyone has to go through it, and the more experience you gain the more aware you will be of how to do go about things. The main thing to remember is to keep things flexible, then if you change your mind on something or find an error in your ways it wont be such a big job to put it right.

Keep up the good work.

Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Oct 2010 11:41 Edited at: 12th Oct 2010 13:11
Quote: "rem since all these buttons function the same I will discribe just one in detail"

Hmm.. they all FUNCTION the same way do they? Hint, hint.

Quote: "if mousex()>120 and mousex()<520 and mousey()>210 and mousey()<270"

Using static values like that is going to cause trouble for you later on. Although you might think the menu buttons are pretty static (it would surely be inconvenient if they weren't! lol) but what if we want to move the buttons around and position them differently? We'd have to go through all that code and change it all. If you use variables it's easy to change everything. Variables are also the first step to building a function. I don't think I've seen you write a function before so I will take you through the process of writing one...

You recognized for yourself that all your buttons are similar, that's the first step. Now let's make a list of the things that vary between buttons:
* The position of the button
* The string printed on the button
* When the buttons are displayed
* What action is taken on clicking the button

The first two are easy, they will be parameters to be passed to the function. Here's a quick example

You see how I've used hard numbers and variables and both work, the variables even have different names. That's the great thing about functions, they'll work with whatever you give them. You can use one function for loads of programs or use ones other people have written without ever seeing your code! There is one condition: each parameter you supply to the function has to be the same type as defined in the function declaration.
You see I put an END after WAIT KEY, that's to stop the program running into the function declaration, the program will crash if that happens.
I'm not sure if ink -2,0 works in DBP but I found it produces white in DBC and is quicker to type.

Our function works yay! But it's not very "functional" at the moment, we're still having to type in the position and name for each button. What we need is an array to store the data for the buttons. The buttons we need are: CONTINUE, NEW GAME, OPTIONS, END GAME and EXIT TO WINDOWS. We wont worry about when they should be displayed or sub-menus yet. Array time:

This has an extra layer of awesome; the first data statement is how many strings there are (don't forget string 0), this is read into a variable which is used to dimension the array and read data into it. This means we can add more strings to the list and as long as we remember to change the 4, it will still work perfectly. I could have said max=4 but the beauty of using data is that if there was more than one group of data I could have quantity markers like that for each group and read them all into the same variable and use the same for loop for all the reading.

SO? - I hear you think - how does this help our button function? It helps like this...

That was almost, too easy... no, no it's just easy. Now we've chosen to line all our buttons up in the middle there's one part of our function that's a bit pointless. Can you see it? I will put it in a code box to give you a chance to spot it on your own.


So now we've got our buttons all lined up and looking pretty sweet but WAH! They do nothing! They're broke... oh yeah we haven't written the zone detection and clicking code yet.

In case you didn't believe me about the compatability of functions - firstly, how dare you! - we're going to use Eminent's MouseWithin function to check the area of our buttons.


I'll be back to finish this in a bit.

Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 12th Oct 2010 15:59
@Obese and BN2, thanks for the comments, guys. I lost you on a few things, but I'm getting most of it.

Also, I'm getting a new computer this week, so to add to the complications of posted my code on a different computer than I write it on, I will now have to be building a whole new computer. I'll try to keep up.

yrotate when you can spin?
God Bless!
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 12th Oct 2010 23:48
I dont get what you guys want from me.

As level creation goes, what is there to do?
gradually increase the number of aliens?

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Oct 2010 02:20
First off, go back and check my notes on some of your older code, as I am having trouble getting it to work.

As far as your current assignment goes this is how it looks:

We need a way to have multiple levels. There are 2 schools of thought for this:

1)Hand made: each level is made individually and saved externally. This requires the creation of a level maker, that is, a program that will quickly and efficiently let you create, modify, and save the files. Easy approaches would be just using the SAVE ARRAY command to save the levels, more user friendly would be have it save it in a useful format (such as a text file that stores the data). I can provide more info and tips should you want to approach it this way.

2)Program made: This process is called "procedural generation." Basically the program will generate what each group should look like based on level and wave numbers (so level 1 wave 5 would have a difficulty of X which would use these rules to create a cluster of aliens to fight). This is more tricky, but can be an interesting challenge.

Personally, I would suggest sticking with option 1. However, if you think you can realistically pull 2 off, run your concept by me (in DETAIL) and we can work out the mechanics.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Daygamer
14
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 13th Oct 2010 03:17
Just to let you guys know, it is likely I will not be able to code until this weekend, and then there is a chance I could be replacing my computer. Just in case it changes anybody's plans.

But I am still excited about this project, and willing to work hard when I have the time (just wanted to communicate)

yrotate when you can spin?
God Bless!
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Oct 2010 03:21
@Daygamer
Thanks for the update. Understandable if you won't be able to code for a while. If you catch yourself with a little free time, pseudocode can actually be more helpful in the long run that just sitting down and coding.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 13th Oct 2010 04:15 Edited at: 13th Oct 2010 04:16


sorry didnt see what you said until now. This should work fine
though


I will improve on it with your guys suggestion in a sec

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Oct 2010 04:29
@Aj

Excellent, thank you very much. It works fine, obese had some good pointers a few posts up if you want to look into ways of tidying it up.

I had to throw in the INC loopcounter,1 command into enemyprops: to maintain code structure. Nothing you did wrong, just putting it out there so that you know how things are working so to speak.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 13th Oct 2010 04:47



This is what I'm trying to go for, level 1 has 5 waves and the next wave comes after a certain amount of time regardless of whether the previous wave has been completely defeated.

I'm going to try to do both of BN2's ideas for the level creation, and I just want to know if this is alright before I go making up a plan of action

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 13th Oct 2010 05:41
Hmmm looking good AJ

Couple questions:
What is the third row of wave 2?

After this does it just become all gold?

Don't forget you can do waves of all one color if you want (Wave one could be all white for all rows and such)

I like the idea of variable timing for the waves. Include a condition where if the time between waves is 0, wait until the wave is destroyed before continuing. It is a little extra code but it can go a long way (especially for the first levels when it should be easier).

Also, don't forget a condition to bring in the next wave should the player defeat all enemies really fast.

Your level design program (to hand make the enemy waves) will require some way to adjust the time between each wave. Alternatively (though more limiting) each level will have a set time between rounds and as you finish each set of 5 waves the number will decrease.

Keep these factors in mind if you attempt the procedural generation:

These factors determine difficulty: Numbers of each type of alien, time between waves, number of waves, speed of aliens, dispersion of aliens within block (more complex, only attempt if you have extra time and motivation).

Warning: Procedural generation can be tricky. In this case just keep an eye on everything. If you start to realize you have bitten off more than you can chew, back off and go to the manual option and revisit procedural generation later.

Misc Thoughts:
It doesn't seem like your code for controlling the aliens contains anything to keep track of what kind of alien there is. The benefit here is that you can modify as you work on this task so that they work the same (as opposed as trying to make the new set of code match older structures).

I will post more as I think of em, but this should give you some things to keep in mind.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 13th Oct 2010 07:57 Edited at: 13th Oct 2010 08:12
@AJ
Looking good so far, I like the idea of impatient aliens They are INVADING after all, why should they wait?

How are multiple waves going to fit on screen though? Two methods I can see, one is you just queue them up until there is space on the screen (either they wait for a line to be cleared or if they're smarter they move into gaps in the formation), or when a new swarm enters the screen we "zoom out" so they all fit in the screen.
I think it would be cool if the "mothership" deployed these new waves, and if you shot it down you'd delay the next wave.


Good to see you using an array to store the alien positions, you will have to move the dim statement though because that code will run at the start of every level; you only dim once.

Please read my notes on the positioning earlier, the highest numbered alien is not necessarily the furthest right. The maximum number of aliens (unless we do the zooming out thing) is 55, 5 rows of 11 aliens. The aliens are positioned row by row from 0 to 10, 11 to 21 and so on. Can you give me a formula that will work out the column any alien (0-54) is in?

Attachments

Login to view attachments
old_School
14
Years of Service
User Offline
Joined: 29th Aug 2009
Location:
Posted: 13th Oct 2010 09:54
I have a idea on how this should work easly. Mother ship throws out the invaders in a set amount to begain. Program will keep track invaders killed. After x amount of unvaders have been killed. Toss out 1 new invader ever 3.5 seconds. This will give the invaders plunty of time move down before the row fills.

Now to prevent filled screen as a extra percation. Set a amount on invaders to be tossed out based on level. You could also set speed they invade downward by level.
AJAtom
15
Years of Service
User Offline
Joined: 25th Feb 2009
Location:
Posted: 13th Oct 2010 23:24 Edited at: 14th Oct 2010 01:50
the aliens in my program are set up like this

1 6 11
2 7 12
3 8 13
4 9 14
5 10 15

I set it up in descending order rather than in rows so the highest numbered sprite will always be the farthest right.
I just thought it could be easier.


Also this is my plan for Procedure Generation.

First off there will be 3 things that will change level to level and wave to wave. Those things are.....

Amount of Aliens in a wave
Types of aliens in a wave
Number of Waves in a level


--Amount of aliens in a wave
if the current level is 3 or higher, the number of alien rows added on can be found by...Taking the current levels number, subtracting three, and then adding the wave number (if its level 4, wave 2 then 3 new rows of aliens will be added). This increases the row number by one every single wave.

--Types of aliens in a wave
Im gonna have trouble here eventually....
anyway, the first wave always has easy aliens, with a 60% chance that the last row will have normal aliens.

The next wave's and onward are created so that all the aliens except the first row move up a difficulty level. with a 30% chance that the last row will move up another difficulty level.

--Number of waves in a level
found by the level number multiplied by 2

------------------------------------------------------

Alien difficulty:
Easy Alien: Fires 1 shot (500 points)
Normal Alien: shot follows the aliens path (2000 points)
Hard Alien: Fires 2 shots (3000 points)

Alien Mothership: flies across the screen and dispatches the next alien wave when reaching the middle of the screen. It can be destroyed for 5000 points causing the next wave to get delayed 7 seconds.
Keep in mind though that the mothership cannot be destroyed when dispatching the first wave.

old_School
14
Years of Service
User Offline
Joined: 29th Aug 2009
Location:
Posted: 13th Oct 2010 23:33 Edited at: 13th Oct 2010 23:34
Just throwing out some concept art for maybe the next version of this game. Keep in mind Im not a artist lol Just figured might be cool to have the next version lined up.

http://i53.tinypic.com/169rhnk.jpg

Concept being instead of the traditional style of play. What about more of a moving attack concept.

Attachments

Login to view attachments
Libervurto
17
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Oct 2010 02:54
Quote: "the aliens in my program are set up like this

1 6 11
2 7 12
3 8 13
4 9 14
5 10 15"

That's clever AJ . Remember to start at 0.

For the level/wave composition, we can't have any randomisation or the high score table will be unfair. I'm too tired to think now, I'll be back tomorrow.

@OldSchool
Interesting concept.

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Oct 2010 03:03
Quote: "For the level/wave composition, we can't have any randomisation or the high score table will be unfair. I'm too tired to think now, I'll be back tomorrow."


If it is proceedurally generated, it won't be random, as it will always generate the same waves, we just don't have to hand make them.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Oct 2010 20:27
So its been a quiet couple days. Just looking for an update.

@aj
Any progress/problems?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose

Login to post a reply

Server time is: 2024-04-19 18:22:43
Your offset time is: 2024-04-19 18:22:43