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.

Work in Progress / Blast Invaders

Author
Message
Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 21st Jun 2007 21:29 Edited at: 21st Jun 2007 21:32
Alright, started on Blast Invaders, and I have lives, bases, enemy array, scoring, shooting, and movement all in.



Not much to look at, but it is getting there. I'm trying out arrays and I hope I'm using them correctly.

I created a shooting code, but personally I think it looks sloppy. I wonder if someone wouldn't mind looking over it, and giving me some pointers.

Is there a way to do 'Cases', like in C? Instead of doing a bunch of 'If then's', you set up a case check, it goes through each case, and checks if it's true or not, then performs an operation.

I'd also like to make the shooting code into a function, but I don't really understand them fully. I can do simple functions, like camera control and stuff, but how can you effect objects and variables globally? Seems whenever you setup a function with variables, the variables are all local to the function. Every time you call the function, it creates it's own separate variables, no one call uses the same ones. Is there a way to use variables globally?

Code:


On to enemy AI!! Yah, can't wait...well, I can, because I'm a little nervous on the subject, lol.

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 22nd Jun 2007 00:40
Just looks like Space invaders but just in red.

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 22nd Jun 2007 02:20
Thought I told you never to post in my threads again, because you have nothing intelligent to say? Not to be rude, it's just you never do. Though thanks for answering my programing questions!

Blastwave Man


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 22nd Jun 2007 18:36
Hey I've been banned for it now just let it go. And hey I'm a member and member=post. But either way i like it. I know it looks red and its entirley your own. So if I forgive you like i said over +100'000 times now I'm gonna post it here and i mean it and im gonna email to you thats how much i mean it.


Sorry, I know we had a bad run in with the past but the past is the past we can't get it back now.


Now Emailing...

The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 22nd Jun 2007 22:09
Guys knock it off. Deathead can say what he wants Blastwave at least he was commenting on it. Maybe it was compliment saying it resembled a really good game? That was real rude of you. Nevertheless keep up the good work if it's anything like the original I'm looking forward to playing it...

Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 22nd Jun 2007 23:34
And hey im a big Space Invader fan so i was complenmenting it in a way because i'd play it.

Master Xilo
18
Years of Service
User Offline
Joined: 8th Sep 2006
Location: Bern, Switzerland
Posted: 23rd Jun 2007 00:30 Edited at: 23rd Jun 2007 00:31
Quote: "Is there a way to do 'Cases', like in C? Instead of doing a bunch of 'If then's', you set up a case check, it goes through each case, and checks if it's true or not, then performs an operation."


yes, let's make it with the variable "x":

using if:


using select:


Quote: "how can you effect objects and variables globally"


objects are alredy globally effected. If you need a global value, set it up as global. Example:
Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 02:59
Deathhead/Crazy:
It's not just the comments, it's the fact he took my idea and posted a game theory on it as his own. I was nice about it before, but I guess he didn't read my request from a month back, or he forgot. I was going to send an email to yah Death to keep this out of this post, but I guess that won't happen, lol! I guess I'm not a fan of nothing posts.

Master Xilo:
Thanks alot. I figured out the global variables on my own, but I don't see why you have to declare them as global if you already declare them before hand with a value, and it's declared in the function declaration. Lol, think I confused myself.

I'm going to try and switch some things into cases. I think it's a little cleaner looking. I'm wondering if they can have multiple commands like 'if/then', or an array can be used to switch through 100's of cases with only a few lines, instead of 100 lines. I'll find out here in a bit, lol.

Update soon, almost done with the enemy destruction and game over code. I'll post the end product, then try and update everything and repost.

Later

Blast...wave...MAN!


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 23rd Jun 2007 03:06
Blast: Dag, yo! I had a feeling there was a back story... now I just feel dumb.

Anyway, Xilo, I had no idea you could use cases in dbp! I'd known of them from a c++ class I took but didn't even think about it being for this. I've already implemented this in some of my own code and it saves me a lot of time! Thanks man.

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 03:33
Yah, I looked in the help files, but couldn't find anything on Cases, unless I'm blind, lol.

Anyway, big update, got everything finally implemented. Just have to fix the enemy collision and it's done. Think I'll do Frogger for my next small project.



Will probably make the enemies bigger to fill up the screen. Theres also a space ship that flies by and shoots, but I didn't wait to take a shot, lol.

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 23rd Jun 2007 04:20
We have cases... it is the Select Case stuff.



I'm not a real programmer but I play one with DBPro!
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 23rd Jun 2007 05:23
ya xilo explained it

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 07:31
Well, finally done!! Though, I will admit I started to get sloppy with my coding in the end. Though I'm not worried about it, I learned what I needed to learn from doing this project.

Screen Shot:


Source:


and attached game at the bottom. ENJOY!

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."

Attachments

Login to view attachments
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 23rd Jun 2007 07:46
Oh, my gosh!!! That was so friggin' fun! I did notice it was easy but I loved it man. The sound went perfectly and it was real smooth. Great job man. To rip off a great show, 9.7/10 Galactic Credits



Note: The show I am referring to is the Milk Paton Show

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 07:52
How far did you get till you died? and what was your top score?

Glad you liked it!

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 23rd Jun 2007 07:56
Well, I got to around 2000 before I stopped, posted here, then sent u an email (btw check your email) but I'm about to play it again right now.

Everyone: Download this it's totally awesome

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 08:06
Yah, I dare yah to get farther, trust me, it gets harder real fast.

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 23rd Jun 2007 12:50
Nice Blast. Its looks great now! What are you working on now the UFO?

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 23rd Jun 2007 15:43
? Game is done. A UFO does come out and shoot at yah, you would know if you played the game.

Anyway, decided to make asteroids as my next project. About half way finished actually

BWM


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 23rd Jun 2007 16:50
Nice can't wait.

The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 23rd Jun 2007 19:56
Asteroids? Where'd you get that idea?

Deathead
17
Years of Service
User Offline
Joined: 14th Oct 2006
Location:
Posted: 23rd Jun 2007 20:29
I think Asteriods sounds quite good. And hey Blast can't wait to see more of your games.

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 24th Jun 2007 00:06
Will be making a Blast Asteroids thread a little later, once I get some good old asteroids flying around screen. This will be by far my most beautiful looking code I've done, lol. I've implemented as much as I have learned as I could into it.

The game will have a high score feature, start menu, levels, increase difficulty, and all the goodies of the original asteroids.

Thanks for all the help guys with learning some coding tricks.


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
GatorHex
19
Years of Service
User Offline
Joined: 5th Apr 2005
Location: Gunchester, UK
Posted: 24th Jun 2007 00:12
You code would so much nicer if you used functions, but it's a nice game all the same. I like the shield damage. Well done!

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 24th Jun 2007 00:18
Yah, I'm still fiddling with functions. Still get some weird bugginess when I try different things, but I'll eventually get it down. But I did get real sloppy in the end when programing the last bits of the game, lol.

So what was your high score GatorHex?


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."
Bozzy
18
Years of Service
User Offline
Joined: 10th Sep 2006
Location: Birmingham, UK
Posted: 24th Jun 2007 02:47
Yeah, bet you can't beat this amazing score... I spent so long getting and I want to share how amazing (ly crap) I am at this wicked game!



Nice game though!

Cheers,
Bozzy
The crazy
19
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Behind you
Posted: 27th Jun 2007 19:04
w00t New High Score! 4195

Blastwave man
18
Years of Service
User Offline
Joined: 12th Sep 2006
Location: ...don\'t look behind you.
Posted: 27th Jun 2007 20:15
awesome!


"I wish I was a wizard, becuase then I could wave my wand and perfect code would just appear."

Login to post a reply

Server time is: 2024-09-29 20:27:35
Your offset time is: 2024-09-29 20:27:35