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 / Dark Noobs Pro (ject)

Author
Message
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 23rd Mar 2009 21:41
What size shall i do the pixel art of the plane and what colour shall i have the plane.

life is short but so am i
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 24th Mar 2009 00:53
z i l c h vortex:
just look at the resources i gave you they should give a good reference...

Pillarofire:
im not a coding genius and i havent done a menu before so im sorry if im wrong...
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Mar 2009 01:47
The menu must be handled in a loop so that any input can be received and handled. That said, it doesn't have to be done in the main loop.

AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 24th Mar 2009 02:35 Edited at: 24th Mar 2009 02:37
Quote: "The menu must be handled in a loop so that any input can be received and handled. That said, it doesn't have to be done in the main loop."


Ya, but it typically is. It's good practice to handle your game in a bunch of states rather than several different loops, i.e. this:



Is not suggested, because to go back to the menu during the game you'd have to use a goto. Instead this should be used:



Because you can switch game states (such as from credits to menu) very easily. Also it shortens your code, because in the first example the input must be updated and the display must be updated in every loop; with one main loop these things only must be called once.

Thank you.
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 24th Mar 2009 02:42
lucifer 1101
I wasn't saying you were wrong and you probably are a coding genius, I was merely wondering about your reason.

My reason for excluding it from the main loop is primarily, because the main menu doesn't need to be executed on every single cycle. Though you could use a simple if-then to prevent that and still include it into the main loop, I like to keep is separate because it just makes sense that it is a separate routine, and also because when the project gets larger, there is no need loading the main menu media and keeping it around while you could use the space for other media. It doesn't really matter too much, it is just the way I like to do it. Should we have a separate GUI menu system, that, I would definitely include in the main loop, because we want it accessible at any time, and the loop would provide the handler.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 24th Mar 2009 06:42
pillaroffire:
Quote: "Rem ***** Main Source File *****

` Define UDTs

` Declare Variables
"


what is the UDT's thing?
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 24th Mar 2009 09:58
alright people heres what i have come up with for a simple menu



if other people could start to fill in the othe blanks that would be great....
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Mar 2009 10:38 Edited at: 24th Mar 2009 10:41
@Andrew: You are right.

@Pillarofire: As AndrewT suggested, you should put the menu code in a separate function. That makes the main loop look much cleaner; also, you could have your menu function check if its required media is loaded when called and elseways load it up on the fly.

@Lucifer: UDT's are User Defined Types, which are very useful.
You can for instance have this:


That makes expanding a project quite easier as well.

Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 24th Mar 2009 11:40 Edited at: 24th Mar 2009 11:53
Quote: "As AndrewT suggested, you should put the menu code in a separate function."


I agree with you there. The menu should be its own entity and thus all of the code that makes it do what menus are supposed to do should be packaged into a function which you can call from the menu loop.

@lucifer 1101:
Nice work the menu works like it should. My only suggestion is to, like I said above, package the functionality into a function, so that we don't have lots of code right there before the main loop.

In essence I believe the main loop should look something like this:



Of course all the subroutines and functions would be declared. In this way, we don't have to sift through a lot of code to find the main loop, or whatever we are looking for. In general our file looks much cleaner, like Rudolpho said.

EDIT: Below

Another advantage to working like this is that we can write multiple functions that do specific tasks, for example:



Now we have modularity; anywhere we would like to use a button, we need only call the Button() function.
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 24th Mar 2009 22:38
Cause i seem to be the noobiust(not a word) one here what are udts?

Thank you.

life is short but so am i
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 24th Mar 2009 23:14 Edited at: 24th Mar 2009 23:15
Ok ive made a draft of the plane here it is critisize tell me what to do.



life is short but so am i

Attachments

Login to view attachments
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 24th Mar 2009 23:33
Hm, I described the UDT concept in my post, didn't I?

z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 00:53
Got it sorry. what colour shall i do the plane?

life is short but so am i
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Mar 2009 00:55 Edited at: 25th Mar 2009 00:56
Ok, no problem

That's a good looking sprite for being drawn with paint.
I vote purple, just because (not very stealthy)

Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 25th Mar 2009 00:56
Good luck guys, i look forward to seeing the finished result

lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 25th Mar 2009 01:20
i think it should be green with yellow stripes...
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 25th Mar 2009 03:33 Edited at: 25th Mar 2009 03:35
@z i l c h
looks good!


Anyone have any idea how to do this game's routine?
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 25th Mar 2009 05:39
@z i l c h vortex
Sweet.

@Rudolfo
Who needs stealth when you got big guns?

@Ashingda 27
The routine? Which one? There will be many routines, unless I am totally off my rocker.

We should have several arrays of UDTs, one for the enemies, one for the enemy projectiles, one for the player's projectiles, and one for the players (yes, that means maybe multiple players).

On each cycle of the main loop, if the player presses the shoot key an index will be added to the player's projectile array, and the image, damage, coordinates, etc. data will be initialized for that projectile.

There will be code to handle each element in the array, telling the projectiles to follow a defined path, from point of inception to the edge of the screen, or collision with an enemy. In actuality the coordinates of the projectile should be updated, then collision detected, then the projectile should be drawn or deleted, and damage used to subtract from the HP of the target (object on which collision occurred).

A similar routine should be devised for the enemies, enemy projectiles.

The players routine will consist of simply checking keystates and performing either translation, or Projectile spawning.

Does that make sense?

This means that we need several functions.

The functions should be declared using Unique verbs/action phrases for what they do.

I like to capitalize the first letter of each word for functions; using modified CamelHump notation.

or instance:

1. Make a function that will create a new projectile for the enemy.
2. Make a function that will handle the projectiles for the enemy.

Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 25th Mar 2009 09:59
I was actually thinking about the stage and the sequence at which the enemies spawns, we'll have to make some kind of stage maker?
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 25th Mar 2009 10:14
Ahh, I'm trackin. Yeah, sounds like a good idea.
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 19:49
whats the final decision on colour?

life is short but so am i
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Mar 2009 20:10
hey, guys. i'm watching this thread with interest, too

i want to suggest NOT having a group quorum on every little detail (especially art, such as the plane's color) as this will seriously impede progress.

since zilch has been assigned the role of artist in this project i suggest allowing zilch to make such decisions. you all have roles and you should all have a level of trust amongst one another while remaining open to suggestion and constructive criticism when code and art is posted for review.

otherwise, best of luck on this. looking forward to your progress

z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 21:50 Edited at: 25th Mar 2009 21:51
Ok so ive added colour just need critisism and improvement points.



life is short but so am i

Attachments

Login to view attachments
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 25th Mar 2009 21:58
Just to quote Virtual Nomad here...

Quote: "i want to suggest NOT having a group quorum on every little detail"


~QJ
That's what they WANT you to think...
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 22:01
Fine there it is like it or not

life is short but so am i
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Mar 2009 22:37 Edited at: 25th Mar 2009 22:37
very nice. the shading is really good.

you'll need to decide how you'll be handling sprite/image transparency. you can use set image colorkey (i'd suggest using standard magenta RGB(255,0,255) for the transparent/background color) or save the files as 24 bit .png images. since you're using paint, i'll be happy to convert to .png upon request.



Attachments

Login to view attachments
z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 23:24
Thank you very much you should join the team.

life is short but so am i
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 25th Mar 2009 23:35
Quote: "you should join the team."

maybe next project

z i l c h vortex
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: united kingdom
Posted: 25th Mar 2009 23:45
Ok

life is short but so am i
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2009 01:32
Nice work on the plane!

Will each enemy plane have an AI? If so I think I have an idea of how to do it.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 26th Mar 2009 02:11
Zilch Vortex:
The plane looks awesome, i cant wait for more to pop up..

Ashingda:
Yes i think each of the planes should have a seperate AI so they all move according to theirselves and not as one....
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 26th Mar 2009 05:14 Edited at: 26th Mar 2009 05:23
@Virtual Nomad
Thanks for the support.

@Ashingda 27
Alright, awesome go for it. Try to make an AI system using these UDTs (posted below in code), if you need to modify them just let us know. Try to make the system as modular as possible so that we only need to call a few functions from within the main loop. Post them here when you get them working, if that's alright.

@lucifer 1101
I'm going to assume that we are building off your menu code, since you were the originator of the project. So I will maintain the updated version of our main project file and start working on these functions:

SpawnEnemy( ... )
SpawnEnemyProjectile( ... )
ControlEnemyProjectiles( ... )
ControlPlayers( ... )

If you would work on the Menu and the Graphical User Interface(GUI) that would be top notch.

EDIT: goram typos...

I will post the code again when things are more fully functional, but here is the complete source code I have so far:
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 26th Mar 2009 06:47 Edited at: 26th Mar 2009 06:55
great work everyone, we are well on our way to getting this done..

i have just made a new function that will make putting the buttons in simpler, i will update it to become more complicated and have advanced buttons but for now here it is...



If you see anything wrong with it please let me know....

i will update the full code a little later on to incorperate this and try to do a bit more work on the menu....

if anyone can come up with a title screen that would be great, even just a layout so i have a fair idea how to put it together....

EDIT1: I have also just updated the first page for new eyes...
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2009 07:31
Ok I'll start working on the AI maker but some things that I need to know first.

1. What screen resolution are we going to use?
2. For backgrounds, will we use Tiles or a Large Looping Image?


Zilch you up for drawing enemy planes as well?
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 26th Mar 2009 08:10
ok im gunna say

1. we go for a 800 x 600 size

and

2. I think a looping image would be easier and we wouldnt need tiles anyway...
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 26th Mar 2009 13:10 Edited at: 26th Mar 2009 13:36
How about sliding large tiles?

like:



EDIT:
@lucifer 1101:
I found something that was catastrophically wrong: lebelColor, OMG I almost had a heart attack. Joking...

Seriously, that is just what we need, excellent work.
lucifer 1101
15
Years of Service
User Offline
Joined: 26th Jan 2009
Location: Melbourne, Australia
Posted: 26th Mar 2009 14:08
that would actually work really well but is it easy to code in and have it placed with no join line...

p.s. instead of the player plane moving the BG should be scrolled...
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 26th Mar 2009 14:28 Edited at: 26th Mar 2009 14:30

Exactly.

Is it easy? I dunno. Never tried, but I will and tell you.

Oh btw, I would change your [center text] in your button to be:
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2009 18:00
Quote: "How about sliding large tiles"

I've done those befor it's pretty easy.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Mar 2009 18:11
Just a hint, when declaring a variable a float (or double float, for that matter) you do not need the '#' sign at the end. I am unsure whether it will even work like that, maybe it does, or maybe you get a new variable alltogether (I wouldn't think so, but it doesn't seem completely unlikely; adding the # is like saying "make this a float", then straight afterwards "as float" again - it would seem the compiler could get confused). In either case, I for one find those # and $'es rather annoying when they don't need to be there anyway

James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 26th Mar 2009 19:07 Edited at: 26th Mar 2009 19:25
Hi, hope you don`t mind me pointing this out, but the compiler does not seem confused by the variables` defining character during declarations in this way. I get the same result if I remove them from the following code

One key thing to remember is that without those added symbols you might find it a little confusing spotting when float to integer or integer to float conversions take place when they shouldn`t(debugging), I find it far more useful to know what is what without having to look at the declarations when returning to old projects and in large projects too. `Each to their own`?
You might note the remmed out block is from the helpfiles and seems innacurate with regards to floats and double floats. My understanding was that 7 digits is 7 numerical values as opposed to 6 numerical values and a decimal point(floating point). If I was to assume the latter, ie 7 digits=6 numerical values and decimal/floating point, then I was still expecting to see a further 8 digits which I don`t. I smell a bug here, but I am using the new IDE with U7.3. I`ve tried with 7.2 also but even following Lee`s instructions the IDE won`t revert back, can someone test the code using 7.2 using an IDE other than the new one please?
Likewise can you scrutinise what I just wrote for mistakes - perhaps I have somehow misunderstood something here.

EDIT: Got the old editor working, same result though.
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2009 19:53 Edited at: 26th Mar 2009 22:20
Do we need to declare all the variables or just the special ones? It will be good to not do things that are not necessary.

I cant work on an AI maker until there's a working example of the game itself first.


We need someone to code the plane flying over water.

1. Plane must be able to move with arrow keys.
2. Plane must be able to make shots.
3. Water must be scrolling. If anyone has a Background Image to use then use it if not then use this water tile.

Attachments

Login to view attachments
Quirkyjim
16
Years of Service
User Offline
Joined: 18th Oct 2008
Location: At my computer
Posted: 26th Mar 2009 22:34
There are two alternate ways of defining variables in DbPro.

You can either use the special sign, e.g.

MyInt
MyFloat#
MyString$


or you can use the AS operator.

MyInt as integer
MyFloat as float
MyString as string


Either way works, it's just recommended to use the AS operator, as using signs is "cryptic."

Also, just to avoid confusion: if you define a variable using a sign, you have to use it with that sign.

Finally, it's the same with functions. If you have a sign for a variable in the parameters, you have to use it with the sign the entire way through. Same way with using AS.

For Ashingda, you do have to declare any variables that you're going to have w/out a sign. If you use a sign, it's automatically declared the first time you use it.

~QJ
That's what they WANT you to think...
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Mar 2009 23:04 Edited at: 26th Mar 2009 23:05
@JamesH: I believe (and take notice that I am not definitively sure about this) that the double precision points to how precisely the decimals are repressented and rounded off, and not necessarily how many actual decimals you can have. Given the fact that the size of a double float is 8 bytes and that the extra precision should only use one of those, I'd think it would also be able to represent more digits than the standard float.

And sure enough, check it out with str$(double float) instead; print won't print all the decimals (possibly it is recast to a standard float in this function), and you will see that it actually can manifest 15 digits.


@Quirkyjim: Keep in mind that there are other quite usable types as well. Dwords are very handy, so are booleans and for most any application (it's not really as if we're very low on memory these days) it is recommended to substitute all floats for double floats. Sure, they take twice as much space, but they can also resolve much smaller numbers, such as calculating sin(0.001) properly (which a standard float would set to 0), and so on.

James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 26th Mar 2009 23:05 Edited at: 26th Mar 2009 23:23
Just the special ones - I forgot to remove the global declaration in the code I posted above, I thought there might be a chance that double floats needed initializing properly. You would initialise variables via global/local declarations. For local variables you don`t seem to have any real need to declare them unless your using arrays - by default arrays are global whereas a standard variable can be declared at any point in the program and is local to the nest it is in and nests "beneath" it - some nests require you to pass the local variable(s) in/out, globals are global so its not an issue for them. By `nests` I mean nested loops, such as for next loops(for t=1 to 10/next t), do loops(do/loop), functions(function functionname(parameters)), goto loops(goto mylabel) and subroutines(gosub mylabel). Each of these is covered in the helpfiles under there respective commands. Data types, variables and arrays are also covered in the helpfiles in a seperate section which I believe is meant to be read and understood before moving on to the commands. Your best bet is to test these yourself - you will notice how do loops, functions and goto`s act differently than other nests with regards to the need to declare a variable as global, if you aren`t passing it into the respective nest(functions can, goto`s cannot, do loops cannot). If anything I just wrote doesn`t make sense then you will need to consult the helpfiles as I don`t always explain things too well.

Rudolpho, that explains a hell of a lot - quite often in the early days I would occasionally find using the text command fixed things that were not working out as expected.

I tend not to use the as method unless using UDT`s which for most people seem easy to understand. For me I add the data type symbol (mainly floats) purely so I don`t make the error of mixing integers with floats when I first started learning coding in DB. As it stands I have yet to use double floats, so far I`ve had no need to, though there are many occasions I could have or perhaps should have, but I`ve never been `forced` to. I really don`t want a string conversion going on, I still consider it a bug(not saying you do or don`t) and find it really odd that the text and print commands act so differently.
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 26th Mar 2009 23:07
I see, then personaly I prefer using the sign, I can tell right away what type it is and not confuse myself. I dont see why it would bother others to put the sign there though lol.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 26th Mar 2009 23:15
Well, whenever I see # I think precompiler directive
And the $ is outright annoying to type (I realize this is jusy me, but I actually move my left hand down to hold the Alt Gr key and press the four with my right hand; nothing I can do about it - automatic behaviour)

James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 26th Mar 2009 23:26 Edited at: 26th Mar 2009 23:26
Have just added a little to my post - I also think this is a case of `Each to their own` as different backgrounds give different habits. I wonder if any of this been covered in bug reports? Will check now...
Ashingda 27
16
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 27th Mar 2009 02:51 Edited at: 27th Mar 2009 04:03
I'm curious as I'm new to using UDTs. What kind of advantage does it give? I find it very confusing as I'll have to follow through the declaration carfully to be able to know what variable name is usable with it.

I normaly just type out the whole thing like, PlayerX# or PlayerY# without declaring.


In this example, what would be the equivalent to PlayerX#,PlayerY#?


[Edit]
Nevermind I figured it out.

I started on the game, got the water and player to move, someone put the shooting in there.

Attachments

Login to view attachments
Pillarofire
20
Years of Service
User Offline
Joined: 31st Dec 2003
Location: Good Question, <looks around.>
Posted: 27th Mar 2009 09:05 Edited at: 27th Mar 2009 09:06
Here is the part I've been working on.

EDIT: almost forgot.
WASD to move.
SPACE to fire.

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-11-24 07:27:48
Your offset time is: 2024-11-24 07:27:48