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 / DarkNOOBS Project 3: Adventure Game

Author
Message
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 22nd Apr 2009 08:12
Awsome method of layer control! MUCH easier than what I was using.

Also your coding is SO easy to follow.

This helps out alot, at least for me it did. Thanks!
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 23rd Apr 2009 19:09 Edited at: 23rd Apr 2009 22:58
@razerx
Sorry I haven't gotten back to you. I have been majorly busy (most of my posts as of late have been from my nintendo DSi in between classes). The next step was to find any entities within range of the player.

The main tool here will be the distance formula. In code form:


However, it is a waist of resources to check EVERY entity on the map, especially those who aren't even on the screen.

The solution here is to run through the entities and check to see if they are on the screen and, if they are, THEN check the distance. That will cut down on the amount of work.

Conversely, we could simply check if they are within a box that is PlayerX-1 to PlayerX+1 and PlayerY-1 to PlayerY+1. I prefer the distance formula because it is done in one line, but I will leave it up to you.

Assume the Arrays with entity data will be called by:


Class is starting now so I will get back on the rest soon. You can start if you want.

[EDIT]
Ok, done. Anyway, you will use the EntitiesX and EntitiesY arrays for distance checking.

Our screen dimensions are going to be 640x480 so to figure out if they are on screen you divide 640 and 480 by 32 (the size of our tiles) revealing 20x15

Then you simply check if they are >= the screens upper left corner (hereafter refered to as screenx and screeny) and <=screenX+20 and <=screenY+15.

All of this should be in a subroutine, call it whatever you need and change the call in the IF->Then to "If...then gosub..."to keep it organized.

Let me know when you get this far.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 23rd Apr 2009 22:28
Quote: "(most of my posts as of late have been from my nintendo DSi in between classes)"

rofl

what did u guys do in project 2 for the range checking of the towers, cuz that would also work here

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 23rd Apr 2009 22:53
I think it was the distance formula, though I am not completely sure, I didn't have a lot of time to do anything.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 23rd Apr 2009 23:15
what am i first to do if there on the screen?


im new at this
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Apr 2009 23:20
@BN2
If you guys are going to use a tile system for the map and keep track of things (entities, actions, etc.) by what tile they are over. You could check for attack range by comparing tiles. It would probably be less computation.

The first thing. like you said, would be to check if the entity is on the screen. Next, find what tile the player is on. Then compare any enemy's tile to the player's tile.



Enjoy your day.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Apr 2009 08:55
Dang, latch you reminded me movement would be pixel based .

@razer
No difference, since we used the distance formula anyway. For your code, good job! My only suggestion would be to make it more general in the On-Screen check. Instead of IF playerX>1 etc etc, use a variable in place of 1, so that we don't have to worry about the "camera" moving.

Also, don't forget to comment your code. I know what you are doing, but it is a good practice. Here is how I would revise your code:


Alright, misc picky stuff from my end here:
Try to replace your constants with variables. Like I said, the screen position is a big one, but also for how many entities their are (why do 100 checks if there will only be 25 entities on the map?). Also (this is something I just thought of so don't beat yourself up for this one) try using the keystate command for the spacekey and instead of a constant value, use a variable. That way, we could later add in control customization.

Keep up the good work! Next step would be before the damage application but within the onscreen check to perform the distance formula (which I would suggest writing a function for, if you don't understand those, we can explain) against the enemy and the hero and compare it to the range of the weapon. If the range is right, THEN apply the damage, which you already have the code for.

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
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 24th Apr 2009 17:00
@razer
following on from what BN2 said; to get the most out of your code and give it flexibility everything that can be altered should be declared in variables at the start of your program, that way you can quickly change how your program works without having to search through your code for the values to change.
That makes me think of those ships in bottles.

I've stopped working on the maps because I am confused how they will work. Have we reached a decision? Is there anything else I can do in the mean time?

How is the movement going to be pixel-based? I thought it was tile-based.

can't read?
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 24th Apr 2009 19:30
Movement will be similar to old school zelda, where it is pixel based (or REALLY small tiles if you prefer) motion, but the maps are made using tiles, for simplicity.

Collision itself will also be pixel based.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 24th Apr 2009 22:30 Edited at: 24th Apr 2009 22:36
@BN2 + Obese
Perhaps, map features are tile based collision, trees, hills, doors, etc. and entity to entity is pixel based. Collision with the environment could all be setup in the map creation process if the tiles within the layer identify the tile type. If there is an impassable tile, look up the tile number/type in the layers of the map array (similar to how I proposed up above) and prevent the player from moving there or transport them somewhere or whatever.

Or, as a variation, if the tile is impassable, that would be the first check based on the map array, then pixel based for fine tuning so the player could move partially onto the impassable tile.

The tile check would be fast as the tile attempting to be moved too is either passable or not. Pixel collision would be a bit slower but allow much better accuracy. A happy medium between the two would provide the advantages of both methods. So, check the tile first, then use pixel collision if necessary.

Applies to combat too. Like the pseudo code above, check by tile if the entities are within tile range for a certain type of attack, then do pixel collision for the fight or interaction.

@BN2
It may be time for you to declare the map making/tile system. You have method proposals (or at least ideas) from yourself, Ashingda, Latch, That1Smart guy, and Obsese. It may be best to just pick the method and move on, whatever it may be.

Enjoy your day.
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 25th Apr 2009 00:38
here you go


im new at this
Ashingda 27
17
Years of Service
User Offline
Joined: 15th Feb 2008
Location:
Posted: 25th Apr 2009 04:52
Pixel collision shouldn't be slow at all as we are going to use memblock for the collision check and only 1 pixel is checked.

More work will be done manualy making(drawing) the collision tiles and less work will be processed while the program is running.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 25th Apr 2009 12:27
@razer
Quote: " for b=1 to 25 : REM Assumes 100 entities
"

You seemed to have missed my point with that part. Rather than from 1 to a number, it might be best to go from 1 to a variable, which contains the total number of entities in the map.

For the health check, I noticed you used an If Yes, do nothing, else do something format. This will work but would it not be more efficient to simply put:


See? Neater and much more to the point.

Your range check seems to need a little work. A simple approach you could do for this is:
If the absolute value of the player position-entity position is <= the weapon range, then do it. It would look something like this:


And yeah, you could combine the two If's to form one long one using AND, but I didn't feel like it. I usually don't if they are long arguments, but if they are short (ie If a=6 and b=5) I will put them on one line.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Apr 2009 18:15
bn2 raises a good point about overusing one line

i have a bad habit of having a small for-next loop on one line



often i have up to 10 commands crammed into this one line, making debugging a nightmare

so it is good habit to try to space out your code over many lines, unless you have a short series of commands such as bn2s example

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 25th Apr 2009 20:11
i'm wasting your guys time.anyone of you could do this in a few minutes.maybe i'll try to help when i'm more experanced

im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Apr 2009 21:18
no razer, ur missing the point of darkNOOBS, the whole reason we do these projects is to help noobs like you learn, if you wait until ur more experienced then ur defeating the purpose

There are only 10 kinds of people in the world, those who understand binary and those who dont
Latch
19
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 25th Apr 2009 23:48 Edited at: 25th Apr 2009 23:54
Yeah razerx, you're doing great! That's what this thread is all about, learning! These guys have already cranked out complete projects. That means you'll see some results for your efforts. And if you work on your assignments, it'll keep you focused.

The motivation is to complete the project with a team where everybody has a responsibility. I believe that often when we do coding alone, we are only accountable to ourselves - and therefore we cut ourselves so much slack, we may never finish anything. But working together makes people accountable to one another and may provide some very clear goals on the project.

Don't look at your contribution as trivial. It's important to the project; and you shouldn't cheat yourself out of a learning experience. Stick with it.

Enjoy your day.
Irojo
17
Years of Service
User Offline
Joined: 21st May 2008
Location: Eating toast.
Posted: 26th Apr 2009 00:22
@razer
Don't worry about it. If you look back on the first DarkNOOBS project, I was VERY bad at programming. But by the end of it, or in Project 2, you'll notice my coding is actually usable. You are already better than when I started. I know it can be frustrating, but don't worry, you will improve considerably fast if you continue to work on it.


Time is money. I just ripped you off.
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 26th Apr 2009 00:38
@razer

Also (I had to tell Irojo this at the beginning too), don't take my corrections as critisism (at least not the negative kind). I remember he got on my case all the time for saying "Not bad" rather than "good job." It is just my style. Most of my corrections haven't been on your method, which is the most important part. They are mostly notation and small things. For instance, using variables instead of constants is just trying to make you see the bigger picture. The code works no matter if you put 100 or 25, but by using variables, it makes it much more versatile, because it neither wastes resources, nor limits its ability.

So in short, when I correct something of yours, it simply means I know you can do better, and I am encouraging you too. If you would prefer me to use different wording (Like good job over not bad) let me know, I will work on it. The only difference between you and others on this team is this: experience. Personally I have been programming off and on for 7 years now. I taught myself the language and picked up most of my skills from the forums here. You are new, so you haven't been exposed to those things, but that is the point of this team. Hmmmm...guess that wasn't short at all.

Also, for the record, don't think you are the only one who needs help on this team. ALL of us usually correct each other. Personally, I have my own set of coding issues, most of which I try to avoid. To be honest, I am TERRIBLE with memblocks, and I almost never comment my code. Both of these are things I am working on and, to be honest, working with DarkNOOBS has made me better with my commenting (now to get on memblocks ).

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 26th Apr 2009 03:34 Edited at: 26th Apr 2009 03:37
I guess i need to learn how to work with a team.
I just have trouble understanding why other people use certain things.probly need to work on not making my code so sloppy too.

and @bn2 feel free to say anything thats wrong with my code,thats
the only way I'll learn right



im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 26th Apr 2009 08:53
Quote: "the only way I'll learn right"

Thats the idea.

Looks like you put the rangeX declaration on a remmed out line.

Other than that, it looks good. As far as making it neater, don't be afraid to put in blank lines. It dramatically improves the readability if you cluster your code into logical chucks. For instance:



If you were to look at that, would you be able to figure out what it does? How quickly?

Conversely, this could be done:


See? It is a little easier on the eyes. This also helps with commenting. Unindented comments can really hurt the readability of your code. Spacing it out helps tremendously, as does indenting the comments (Not always necessary, I know I didn't but it is an option).

How 'bout we write the code to make the monster go back?

@all
Had an idea, we can use a set of function to control the motion of all entities (including the player) by simply passing it values such as who to move, which direction, and how far.

back @razer
We will assume that the above idea will be taken (at least for the entities). For the move object backwards, lets look at the process to move backwards:

1.Turn 180 degrees (or take note of the direction, it really doesn't matter how you do it)
2.Move the distance back
3.Return to original orientation if changed.

Assuming a numbering convention for direction where 1=up 2=right 3=down and 4=left, we can simply add 2 to the current direction (wrapping of course to keep it within 1-4) to figure out which way is backwards.

However, since a lot of the conventions for the engine itself aren't created yet, we will keep it general using variables, as before.

So, step 1: Structure.

Simply set up the function structure and place its call. Remember, functions are placed at the end of the code after the END command and start with FUNCTION and end with ENDFUNCTION.

You can call it whatever you want, but keep it intuitive. For the calls, I want you to think it through and figure out what will be needed, I will let you know if there are any things you put that aren't necessary or if you didn't put something that is necessary.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 26th Apr 2009 23:01
is this what you meant by useing a function?
(I prefer GOSUB's you can change outside varibles easyer.)


im new at this
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Apr 2009 00:06
Quote: "I prefer GOSUB's you can change outside varibles easyer."

actually functions cant change outside variables at all

and yes that is how you call a function, dont forget tho that endfunction can also send out a value as a result of the function, just put the variable/value after endfunction or exitfunction

There are only 10 kinds of people in the world, those who understand binary and those who dont
t10dimensional
16
Years of Service
User Offline
Joined: 22nd Mar 2009
Location: Code Cave, USA
Posted: 27th Apr 2009 00:18
can't functions acept paremeters?

function(x,y)
endfunction (x,y)

im new at this
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Apr 2009 02:20
They can accept parameters, but they can't return multiple ones. Only 1 single one. If you want to pull strings, though, there are tricks. For instance, if you wan. t to return 2-3 values, all of which will be 255 or less, you can use the rgb() command and use the values in that, then read them out using rgbr() rgbg() and rgbb(). Or you could make up your own thing, but I use that one a lot.

And yes, Subroutines are good for manipulating outside variables. However, the good part about functions is that they ARE isolated. You don't have to worry about using the correct variables or avoiding used ones. Also, the return value is nice because it lets you get a number or string from your functions. Here is the general guideline on how to know which to use:

1. Subroutines: Use if you will be using the exact same block of code multiple times and you want it part of the main program (using variables etc)

2. Functions: Use if you want to perform a series of commands and return a value. Also good if you will be sending multiple values to the command.

Observe these alternatives:

Using Subroutine


This looks alright and is acceptable, but look at this one:

Using functions:


See? It is cleaner, and you don't have to worry about declaring all of those values.

In our case the function would be the way to go because it can do it all with one, rather than either a)having 4 subroutines, 1 for each direction or 2)having an irritatingly long list of variable declarations before the subroutine call. The function has all of that on 1 single line.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Apr 2009 03:35
right,i forgot to mention parameters

ya if ur new to functions one good example of learning a function is to look at the rgb(red,green,blue) command

this is an example of a function, you input values (red, green, and blue) and it outputs a result (some random variable that looks like it makes no sense by itself)

such is also true with the wrapvalue(angle) command, u input an angle measure into the parameter and it outputs an angle 0-360

There are only 10 kinds of people in the world, those who understand binary and those who dont
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Apr 2009 04:45
You Could use memblocks to output more variables. (i know bn2 just said he's not good with em) then you could output strings, floats,integers all in one memblock. strings are kinda tricky for "Memblock beginners" though.

if you don't know. all you have to do is scan through all the characters using a for next loop and the mid$() command. then use the asc() command to gget the ascii value for each character and write it into the memblock. like this.



Sory i know i'm not working on this but i thought i'd point it out

New Site! Check it out \/
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Apr 2009 06:04
Good idea, though I think memblocks might be a bit much for a beginner

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Caleb1994
16
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 27th Apr 2009 06:23
True. Just putting it out there though.


Oh and bn2 one thing the really made me get memblocks was Structures in C++ (or Types in DBP, same things almost) that really helped me.

New Site! Check it out \/
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Apr 2009 17:13
@razer
your code isn't that bad. Mr Tank showed me this simple way of making a "switch" that you could use...

Old_attack stores the previous keystate before it's updated, for the first loop it will be 0 as we haven't checked the key yet.
The only way an attack can be registered is if we are attacking this loop and didn't attack last loop, therefore only one attack will be registered each time we press the attack key.
You may also have noticed I used a variable for the attack key, that will allow us to change the controls without having to search through the code and change every instance of spacekey() to something else.
Try and think about everything that could be variable in the program and declare the variables at the start of the program. Whoever works with your code will be delighted that you've made it so easy for them to alter your program.

can't read?
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 27th Apr 2009 18:59
@obese
Shouldn't that be IF New_Attack<>Old_Attack? It looks like that would require the player to constantly push buttons in an increasing ascii value order, or am I mis-reading it?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 27th Apr 2009 23:03
@bn2
thats what i was thinking

There are only 10 kinds of people in the world, those who understand binary and those who dont
Libervurto
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 27th Apr 2009 23:51 Edited at: 27th Apr 2009 23:52
@BN2
No. After the check, old_action is assigned the value of new_action and new_action is updated by reading the keystate.
Here's a pseudo run of the code (numbers in square brackets show the current value of the variable)...

There you see the complete cycle. Old_action returns to zero and therefore allows another action to be executed on key press.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 28th Apr 2009 01:23
ok i see, i didnt think that old_action was continually updating with the value of the pressed key

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 28th Apr 2009 02:20
OOPS! I was thinking scancode instead of keystate

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
19
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 29th Apr 2009 02:41
@BN2
If it's alright with you I'm going to leave maps alone until there's a clear outline for how they work. (Maybe we should write some design documents, I read a thread on the game design theory board by mattrock and it made sense for our team).

Everyone who isn't involved in the map maker lets look at the other aspects of the game...
The main premise of the game is completing quests to gain allies for the rebellion. So we will need a quest system. Quests would have different objectives i.e. "bring me this item", "kill this beast/person", "give this person a message", "find this person for me", actually these could all come under "bring me this item", if you had to kill something you could bring back its head as proof, and finding a person or delivering a message could require you to bring back the recipient's reply. We could even have a chain of quests where one person would send you to a second person and they would send you to a third person who would have the item you needed to take back to the first.

can't read?
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 02:43
right obese, if u look back to my HUD theres already code in for that

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Apr 2009 03:38
Code for the DISPLAY, but I think Obese means an actual system for managing them, ie you recieve one, and you can complete the quest, but only if you have it etc etc.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 03:40
ok i get ya, should i work on that in the world system or is someone else doing it?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Apr 2009 03:42
Yeah, smart guy, either work on the quest system or world system, let me know what you choose.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 03:57 Edited at: 29th Apr 2009 03:59
ill take the world, just sounds more fun

do you want me to start now w/o the maps or wait until they get done and i can add em in?

also i have a few questions

is the character locked into the center of the camera and we scroll the map or does the "camera" stay still while the player moves?

are the maps screen size or are we going to scroll the maps to see all of it?

i have more but i cant think of em now

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Apr 2009 04:07 Edited at: 29th Apr 2009 04:11
For now, use a simple grid for the map. Have it use the 32x32 tiles and make the code versatile enough to handle non-walkable tiles. For now, just make it check the area where you are going to ensure that it is walkable.

For the character: The character will be locked to the center of the screen when moving in all directions in which the camera can pan. So, if the player is on a map that is 1 screen size, he will move and the camera won't. However, if he is a hallway, he will move until he reaches the center of the screen and then the camera will pan with him at the center.

Which leads me to the next question:
Sometimes yes and sometimes no. Start with a screen size map then make a larger template and make the code work.

I will begin the creation of the skeleton for the engine.

btw, for all those who have created something:

1)Can you please repost it so I can put it in
2) Tell me which arrays you need as well as the sizes for each so that I can put them in.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 04:30
heres my HUD, i think

reason i say that is cuz i had the program on a flash drive, but i left it in my pocket and it went thru the wash..........

so needless to say i dont have it nemore so i went back thru this thread and found what i think was my final program



There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 04:49 Edited at: 29th Apr 2009 05:55
btw r we guna attempt animated water or leave it still?

can the player only move in one direction at a time or can they move diagonally and if so are we gona leave them facing in the first chosen direction as they move diagonally?

are we going to allow the player to hold space to attack repeatedly or do we have to make them press it repeatedly?

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Apr 2009 06:22 Edited at: 29th Apr 2009 06:32
1) Maybe: leave it capable of being expanded, but don't worry about it just yet

2)Diagonally and yes, first chosen direction

3)Press repeatedly, don't worry about that part though, razer is working on it, it is almost done though.

Do you need any arrays declared yet? Just keep me updated and I will update the skeleton. This also applies for any functions you write or need included, just give em to me as they are in a completed state (don't give me multiple versions mid-development, it will just get cluttered)

Also, I am simplifying your HUD code to use an image for everything, rather than re-draw it all every time the program runs etc. It code for all the parts will still be used, though, I just saved a screen shot of the hud.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 15:30
the only arrays i need thus far are in the make_arrays subroutine of my HUD code, but im not sure as to the size of each, they will all be the same size but im not sure on how many weapons the player will have

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 17:23 Edited at: 29th Apr 2009 17:25
so ur keeping my HUD system but changing all the graphics into one screen sized image that will be repasted every loop, gotcha

what all do i need to include into my world system?

also in program are we going to redraw each map tile every loop, save a pic of all the tiles, or have it set up on an off screen bitmap and copy that to the screen each loop?

heres what ive got done thus far:

`working animations for idle, movement, and attack sequences

`working movement system, the only flaw is that some directions "overule" others so if you move diagonally then the direction you face is determined by the last one checked for

`a flag set up to prevent holding space to loop attack

`memblock collision

There are only 10 kinds of people in the world, those who understand binary and those who dont
BN2 Productions
21
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 29th Apr 2009 19:10
You have the memblock collision working already? Alright.

For the map, I wanted to open this one up for discussion.

We can have a map that is redrawn every iteration of the loop, but why? We could very simply just package a saved image of the map and its collision map in with the rest of the saved map files.

So the discussion now: How to present the maps.

Do we have it pre-saved and just thrown up there or do we have the tile data saved and everything just re-drawn every loop.

Thoughts?

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 29th Apr 2009 19:41
right now i have it saved into another off screen bitmap and after the screen is cleared i just copy the bitmap to the screen, redraw the character and bam it works

here my code, i havent worked an the entitys yet but the collision works, also i only have 2 layers at the moment, ground and collision but once we get the maps working we can add in the ground decals layer pretty easily



i cant post the animation grids at the moment so if u dont have em let me know and ill post em as quick as i can

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
16
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 30th Apr 2009 17:47 Edited at: 30th Apr 2009 17:53
just realized something that may well effect our mapmaker, anything taller than the player such as trees will need to be cut into 32*32 images and have the bottom tile placed in collision layer and all others in the above player level, otherwise the player cant run behind a tree

also back to the issue of how to draw the maps, i think if we go with my plan well need many bmps running simultaneously (sp?) for the idff layers, if we have 4 layers then well need 4 bmps, then we can paste all the ground tiles into their proper places in the 1st, ground decals into proper place on the 2nd, collision tiles on the third, and above player stuff on the 4th

then all we would need to do is do this to get the current map and player to the screen



assuming 1-4 would be our layer bmps

There are only 10 kinds of people in the world, those who understand binary and those who dont

Login to post a reply

Server time is: 2025-08-08 20:37:52
Your offset time is: 2025-08-08 20:37:52