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 - Asteroids

Author
Message
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 14th Apr 2011 01:56 Edited at: 15th Apr 2011 01:48
Alright, time to get this ball rolling.

Attached are the design documents. I tried to be thorough in giving an idea of what we are aiming for, but if you guys have questions, ask.

Additionally I have created the project skeleton. This is the code framework we will be building everything onto.

Jobs:
First EVERYONE Read through the Design Documents. They're pretty short (2-3 pgs I believe) and play the example http://www.play.vg/games/4-Asteroids.html.
It would also be a good idea to read this
Then:
Teh Stone: I want you to handle the asteroids. I expect a subroutine for spawning the asteroids (including a check to see if there are any open slots for asteroids), one to update their position and handle collisions, and the ability for them to die/split apart (separate subroutine or with the second one, your choice). My advice: Start out with a single asteroid and once everything works for that one, adapt it to handle multiple ones

DarkByNight: I want you to handle the player side of things. That means controlling the player's motion and shooting. Include checks for collision with the asteroid and other things listed in the design documents.

Project Skeleton:


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

Attachments

Login to view attachments
DarkByNight
11
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Thailand
Posted: 14th Apr 2011 10:19
Right..... I'm clueless.
Any idea where to start?
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 14th Apr 2011 22:18
@DarkByNight
What do you need help with?
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2011 01:17
I've attached a zip file with a couple images of bleh quality, but they should give you something to work with.

Right now what I want you to do is simply get the controls working. So I want it to be able to put the player on the screen and move forward when the upkey is pressed. Turn it with the ROTATE SPRITE and WRAPVALUE() commands. We will adjust it from there.

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

Attachments

Login to view attachments
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 15th Apr 2011 01:34
Which direction do you want the asteroids to reflect when they bounce of each other, doesnt say in the Design doc and they just go through each other on the example (which i have gotten very good at btw)
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2011 01:47
For now make them just pass though/over each other. I am working out the math right now to see if having them bounce off each other correctly is plausible.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 15th Apr 2011 02:47
yeah ive been trying and cant seem to figure anything out, oh well thats the sort of thing i can come back to if one of us has a sudden idea.

I dont have much faith in my maths at this time of night ^.^
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Apr 2011 04:53
@Teh Stone
It hasn't been mentioned yet, but have you thought about how to manage the asteroids array?
When a larger asteroid is shot it breaks into multiple smaller asteroids, so where do you store the data for the new asteroids?

And how do you keep the array from over-flowing with too many asteroids?
If you are limited to 50 asteroids (as the design document suggests), and there are already 50 in existence, there can't be any large asteroids left because if one was shot you'd have nowhere to store the asteroids produced.

There are a couple of solutions, what do you think is the best way to do it?


Be good.
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2011 05:02
Quote: "It hasn't been mentioned yet, but have you thought about how to manage the asteroids array?
When a larger asteroid is shot it breaks into multiple smaller asteroids, so where do you store the data for the new asteroids?
"


Well played Obese, I had forgotten about that aspect. In my version I'm making along side them I haven't gotten to that part yet. Though now that I think about it, I know how I would solve it. I'll save revealing it to let him think about it a while.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 15th Apr 2011 11:54
My solution cod be improved alot, basically what I've done is have a UDT linked to an array to store all the information about each asteroid, speed, x velocity, y velocity etc and a STATE variable for of it exists and if it does then draw it. The array has 52 elements (two more of your 50) numbers 1- 4 ccontrol the big astorieds, 5 - 20 control the medium and 21 - 52 control small. This way there can never be more than 52 asteroids. I know it states 50 in the DD but I thought this would be okay as it is only 2 more and tranisition between large and medium could make 3 or 4 so it sort of balances out.

Then I have a function that can relate the numbers to the numbers of the different class and can spawn more or delete completely.
Ashingda 27
12
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 15th Apr 2011 16:54
I don't think you need to assign a limit to the asteroid sizes, you can simply run a quick check for a non-used element when creating a new asteroid and when it's dead/offscreen you can just unflag it to be open for new uses.

BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 15th Apr 2011 19:48
Hmmmm not the approach I would have gone with, but not a bad solution. I'm unfamiliar with the abbreviation UDT, though, so some explanation would be nice. It is a good solution to the given problem, though it would be a bear to adjust (having to scale everything properly in the array and such). Only point I would make here is:

Rather than have a variable for the state of each asteroid, put it into the asteroid data array, like so:

AsteroidData#(Number,0)=1

Where that 0 spot will have a 1 (alive) or 0 (dead).

This will cut down on how many variables deal with the same thing (in this case, asteroid information).

Here is how I would solve the situation:

Control the spawning based on how many "points" in the asteroids are out. That is to say that a Large asteroid is worth 3, a medium is worth 2, and a small is worth 1. As the asteroids are spawning, it will only spawn up to 50 points. That way, if a large asteroid explodes into 3 small ones, the total number of points remains constant and there are available data slots.

I would expand the "alive or dead" system to contain hit points instead (so instead of AsteroidData#(Number,0) containing 0 or 1, it will have 0,1,2,3 depending on the size of the asteroid). When spawning, I would set up a function that would scan through the array to see if there is an open/dead asteroid slot available, then check my total asteroid budget, and if one can be made, I would do it.

What you get from this is:
-Easy to expand (simply change the total budget and the array size and you can scale up or down all you want)
-Easy to control/monitor(if things stop working you can check the variables easily to see what's happening)
-Easy to adjust on the fly (you could easily just start the budget small and increase it up to its maximum limit to increase difficulty).
-You can have almost 20 large asteroids on the screen at any time (a little overkill, but still)

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
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 17th Apr 2011 01:16 Edited at: 17th Apr 2011 01:17
UDT = User Defined Type, tutorials can explain it better than i can so if you still havent heard of it.

Quote: "Control the spawning based on how many "points" in the asteroids are out."


Much better than my solution thanks for the advice! i will work on that tomorow night

Anybody heard anything from DarkByNight its been a while

EDIT: SPELLING
DarkByNight
11
Years of Service
User Offline
Joined: 16th Jul 2009
Location: Thailand
Posted: 17th Apr 2011 07:01
I'm trying to work it out by myself but I can't even get the darn thing to rotate and move or any thing.
Ohh well, guess I'll try to renew my motivation.
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 17th Apr 2011 09:11 Edited at: 18th Apr 2011 06:47
If you look at the skeleton, I have code there to accept user input. What you will want to do is display the player as a sprite (use a variable for the sprite number so that we can adjust as necessary later) and then use the ROTATE SPRITE command.

And for movement, you'll want to track the object's position and velocity information. Since you will be rotating, it would be easiest to store the velocity info as a magnitude and a direction (the angle) as opposed to just tracking its X and Y components.

The math is EXACTLY like the analog clock math. Velocity*Cos(angle) will give you how much to add to the player's X position. Velocity*sin(angle) will give you the velocity's Y component.

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
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Apr 2011 01:42
Alright, it's been a week or so, how is everyone 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
Teh Stone
10
Years of Service
User Offline
Joined: 12th Dec 2009
Location:
Posted: 22nd Apr 2011 20:26
I'm really sorry I've been really sick the past few days and barely touched my cputer let alone do any coding, I'm still not fully over it but I should be able to submit in a few days time
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 22nd Apr 2011 21:48
That's fine, just wanted to know how everyone was doing.

Hope you feel better soon!

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Game Here
9
Years of Service
User Offline
Joined: 27th Apr 2011
Location:
Posted: 27th Apr 2011 15:27
Professional Game Designers, Developers and Writers, under the banner of InEvoWare Inc, we accommodate all forms of games, including Racing Games, First/Third Person Shooter, Platform, Adventure, Puzzle, Isometric, and more.

Game Here
9
Years of Service
User Offline
Joined: 27th Apr 2011
Location:
Posted: 27th Apr 2011 15:28
Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Apr 2011 19:43
@Game Here
Please refrain from spamming our thread, it's rude.

Your signature has been erased by a mod - The combined size of both images exceeds the max image size (600x120)
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 21st May 2011 11:01
Well this burned out quickly. Anyone still present?

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
10
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 22nd May 2011 04:51
@BN2,
Hey, man, if you need some help I'm probably available now. I love asteroids! Great idea.

yrotate when you can spin?
God Bless!
/2007/dngsig.png[/img][/href]
Darkzombies
9
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 31st Jul 2011 08:08 Edited at: 31st Jul 2011 08:45
Is there any job i can have on this project? I can work on a sprite or something till you respond.

EDIT: still working on sprites, might not do them lol, but anyways, i found some good looping music from my old darkbasic classic, that i shouldnt have anymore now that i have pro . But anyways, if you use you should probally give credit to the maker, Pix. Ill attach.

-------------------SIG---------------------------------

Attachments

Login to view attachments
Darkzombies
9
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 3rd Aug 2011 04:18
i think this is dead :/ no one has responded, well can we do something else? Anyone wanna help with ashingda's project, the fruit wars thing?
It's open-source now and really cool.

-------------------SIG---------------------------------

BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 3rd Aug 2011 04:52
Sorry I haven't responded, I've been crazy busy with my new job and by the time I get home every day, I'm completely drained. Unless someone else comes to take over the project, I'm going to have to shelve it until school starts in a couple months.

Sorry

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
10
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 3rd Aug 2011 06:39
I'm still available, but I not sure I want to take over a project

yrotate when you can spin?
God Bless!
/2007/dngsig.png[/img][/href]
Darkzombies
9
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 3rd Aug 2011 06:40
We could always go with my plan and resume in a month or two.

-------------------SIG---------------------------------

Daygamer
10
Years of Service
User Offline
Joined: 16th Mar 2010
Location: United States
Posted: 3rd Aug 2011 06:46
@Darkzombies, Sounds cool to me, if BN2 is up for that.

Nice Signature by the way. Made me laugh: "You Expected Something?"

yrotate when you can spin?
God Bless!
/2007/dngsig.png[/img][/href]
Darkzombies
9
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 3rd Aug 2011 06:56 Edited at: 3rd Aug 2011 07:29
i was trying to do something like 20 code snippets, each inside each other, and the final surprise was "You Expected Something?" but it didnt work lol.

And ashingda's project is here: http://forum.thegamecreators.com/?m=forum_view&t=161076&b=8&p=0

Go to the last page for source code, although thats only the unfinished editor, i would just wait for ashingda to finish with adjusting it for use.

P.S. you need advanced sprites to compile and use(its a plugin )

-------------------SIG---------------------------------

BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 3rd Aug 2011 07:26
Quote: "@Darkzombies, Sounds cool to me, if BN2 is up for that."


That's the general idea for now, unless an experienced person becomes available. I can't as I now work 40 hours a week and will up until school starts up again in late september. At that time, I'll see what I can do.

@DarkZombies
If you are really itching to get started on something, I would suggest taking one of the older projects (there is a thread for each of them) and try to work alongside the posts. You would basically be working through a game and reading along for the next step and checking answers to the questions you have (because it is pretty likely that they were asked).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Darkzombies
9
Years of Service
User Offline
Joined: 25th Dec 2010
Location: In multiple tabs, most likely youtube.
Posted: 3rd Aug 2011 07:31
not really, i just want to help with ashingda's project. It's really cool and has great potential, plus its going open-source, probally just for darkbasic users, hopefully it will end well.

-------------------SIG---------------------------------

thisotherguy
8
Years of Service
User Offline
Joined: 22nd Aug 2011
Location:
Posted: 24th Aug 2011 02:56

hi, im new here and someone told me this was the latest project. hope you dont mind i had a crack after reading the design docs and playing the game (not that i hadnt already.) threw this together in a couple hours last night. got the player side of things handled now i think. if youre still doing this let me know and ill get started on the asteroids, otherwise please assign me to a different project. if you dont mind advice from a noob, you guys are aiming too low, heck i started coding a week ago and ive pretty much got this wrapped up(was a bit confused about a couple things but the asteroid points thing cleared that up). plus, no one wants to make a game identical to one they can already play. yeah, i know, we noobs are picky that way.

Darkseid?
BN2 Productions
16
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Aug 2011 07:57
Hi thisotherguy!

This project fell apart a while back due to lack of members. However, LBFN just started a new DNG project here. He'd be glad to have your help.

I will try to look over your code when I get the chance to give you some pointers.

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: 2020-08-06 09:01:28
Your offset time is: 2020-08-06 09:01:28