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 / Space Invaders help

Author
Message
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 16th Mar 2009 20:46 Edited at: 16th Mar 2009 21:01
ok so i started trying to make a game again because i've been making other stuff for a while and so ithought i'd start with space invaders.

well i have shooting and i know how i'm gunna do collision. its just the enemies. welli think i know how i'm going to do it but what do you thing about this approach?

i have a editor where you edit "Frames" for where the enemy moves then you save Stages and save those stages into a level. and each frame has the x and y for every enemy in it. then i can just load in the final level text file and use the stages and frames as i need them.

i havn't thought about the enemies shooting yet though.


Heres the game part



And the editor (very far from done lol)



and i attached the images.

New Site! Check it out \/
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 16th Mar 2009 22:19
Looking good Caleb.

First of all this is coded in DBPro and because this is the DBC thread most people here might not be able to run your codes as it is.

Anyways, I think it's better to use a float for the bullet. It's easier to control the speed and you won't have to time for it. Also I don't think you'll need a grid for the space ship.

Your main loop is a bit large for my liking but overall your coding is quite easy to follow. Keep up the good work .
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 16th Mar 2009 22:47 Edited at: 16th Mar 2009 23:14
Thanks! i havn't been programing games for a while with c++ and random little tools that i was playing with so i thought i'd give it a try.


this is coded in dbc. oh whoops forgot to change the globals to dims for the forums :/ I'm using extended syntax on darkedit. its easier then typing (0) after allot of the variables lol

ya i have a habit of making long main loops i was just thinking that a little bit ago. i'm going to shorten it

I'll see about switching the player over to pixel movement.


oh and i forgot about floats :/ whoops i have been dealing with some other programs that didn't use them and i forgot to use them here thanks! lol


Here's the updated code with smaller loop and i took out the extended syntax stuff. and the other stuff you suggested.



Btw i know it is not nearly as important as anything at all lol but any idea for a name? lol this game has been remade so many times that i don't have one. when i first started i though dark invaders then i realized everyone put dark infront of everything here lol

New Site! Check it out \/
Ashingda 27
18
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 17th Mar 2009 00:12
Awsome!

As for a title "Dark Invader" would have been just fine, this game is remade alot cause it's great for learning. You can probly add your user name in there like "Caleb's Dark Invader" or something.

Looking forward to seeing enemies.
That1Smart Guy
17
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 17th Mar 2009 00:26
i tried making one once, but abandoned it, not because of difficulty or bugs, i just kinda lost interest in the project and went to a break-out game, which i eventually gave up in same way.

Come to think of it, i havent finished a project in a while, that will change with my current poker game tho
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Mar 2009 01:55 Edited at: 17th Mar 2009 02:20
@Ashinga

Good point i might do that.

@SmartGuy

hahaha ya me either thats why i really want to do this

@everyone

I'm working on enemies now. it's going ok. really as long as i have the ai editor then the biggest thing is collision with the bullets. which right now isn't working great. well it is just for some reason it doesn't kill the last enemy and i don't know why

well i think i might. it might be because of the way i'm doing the enemy numbers. in the editor if you don't put the enemies in the same order in every frame then the numbers get mixed up but thats something easy to fix I'm going to fix that and see if it works.

heres the updated code




the stage is uploaded its very small though lol.

New Site! Check it out \/
ivan2009
17
Years of Service
User Offline
Joined: 28th Feb 2009
Location: Canada
Posted: 17th Mar 2009 10:32
A scrolling 2d shooter is just like space invaders except the screen scrolls and you have bosses and power ups. That would be a good project to get started on, plus the final game is more playable than a single screen shooter. just a suggestion.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Mar 2009 16:05
i'm not sure what you mean? space invaders was a scroller well it made it look like it with scrolling stars in the back(pretty sure thats what happend) and there are bosses and power ups(not in mine yet )?

New Site! Check it out \/
ivan2009
17
Years of Service
User Offline
Joined: 28th Feb 2009
Location: Canada
Posted: 17th Mar 2009 17:07
I guess I'm talking about games like super star soldier, and raiden. where you have a background you can drop bombs on. space invaders took the creator three years to make.. in 1978. today we can make invaders clones in DB in a few hours.. minutes, even. But an invaders style single screen shooter can have power ups(space invaders DX and '91 did) Good luck with that and any other projects you start.
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Mar 2009 17:38 Edited at: 17th Mar 2009 20:49
aaaahhhh!

ok i got up thismorning opened my laptop and ran my code and it doesn't work now! it worked last night. so i went to my backup version(i made that right before i put in the enemies) and i havn't edited that since yesterday morning and it doesn't work either.


they run but the bullets don't work now. when its in automatic it doesn't shoot exept for about avery 20 or 30 seconds and the bullets move extremely slow on semi auto they shoot every time but they don't move. well they do but every about 30 seconds it will move for about 10 seconds then stop again. heres the code (without the enemies for simplicity)





i can't think of anything that could happen without me editing this. i havn't changed this code since a day ago. and it worked fine then. any ideas?




Edit:


Oh i see what you mean by "Scroller" ok well right now i havn't been in the gaming side of darkbasic for a while i found out i like making random little tools lol so i thought I'd ease back in


Edit2:


Ok i think the timer is being screwy put this in the code above.



the counter variabale(used when in automatic) is going all over the place (including negative) and it's not supposed to. and same with timer-counter it shouldn't get that high it should only get to 10 and counter be set to 0. (btw turn automatic on with x and then hold down space to get accurate results because the counter is only set to 0 when your pressing space and the diff is greater then 10)


try it with bulletcounter also. it does the same thing. i can't figure anything that would cause this.

New Site! Check it out \/
ivan2009
17
Years of Service
User Offline
Joined: 28th Feb 2009
Location: Canada
Posted: 17th Mar 2009 22:30
I didnt look long enough to check most of the problems, but in the part where you say "counter=0" i changed it to "counter=timer()" and the bullets spread out somewhat but still moved slowly(in auto)
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Mar 2009 23:19 Edited at: 17th Mar 2009 23:23
hnmmm interesting i tried it yes they do shoot more but deffinetly not how fast they should. i tried that with the bulletcounter and it made it so the first bullet moves but the others don't. this is really weird.


i'm going to get the code i first posted and be sure that works lol



!!!!EDIT!!!!

ok i got the code i put up here on my second post and it doesn't work either! what is going on here its like a ghost is destroying my code.... aaahhh! lol i think i will switch from using timer() to just adding one to the counter everyloop. it's not a great way but i want this to work. lol

New Site! Check it out \/
Caleb1994
17
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 17th Mar 2009 23:27
ok i did that and now it shoots but only the first one moves once that one is gone the next one moves and so on

and they move slow. i don't know what is going on. i really don't want to start over. lol its not tons of work but its work non the less lol

New Site! Check it out \/

Login to post a reply

Server time is: 2026-07-21 21:27:07
Your offset time is: 2026-07-21 21:27:07