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 / Rate my work!

Author
Message
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 5th Dec 2008 05:01 Edited at: 5th Dec 2008 05:07
hiya all. just seein how everyone likes this game so far
its going to be a ninja game but im waiting till christmas
to get photoshop so i can make my levels. the codes pretty
messy tho

note: this is my first time dabbling in sprites





media is a download cause i dont know how to put it on the page

I like pi

Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 5th Dec 2008 05:01
media 2

I like pi

Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 5th Dec 2008 05:01
media 3

I like pi

Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 5th Dec 2008 05:18
srry for useless post, setting mailback address

I like pi
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 6th Dec 2008 02:15
Well crap..... no reviews so far. im just gonna have to work on it a tad more and post this on the WIP board

I like pi
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 6th Dec 2008 04:08
Just a tip:

Typically people don't like downloading several files and compiling code just to play a game. Try compiling it and packaging the EXE along with the media in a RAR file, then uploading that here. You'll get more downloads, trust me.

Xsnip3rX
17
Years of Service
User Offline
Joined: 20th Feb 2007
Location: Washington State
Posted: 6th Dec 2008 05:40
Also, screenshots help.

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 9th Dec 2008 04:15 Edited at: 9th Dec 2008 04:51
@ Andrew T: I dont know how to make a RAR file ill probably google it in a sec tho
edit: hmmm, what about zipped files?

@ Xsnip3rX: screenie! you have to squint to see the aiming dots

Note i was merely looking for what people would like to see in the game and how my aiming system, physics, etc. was

ASC(32,95,179,95,218)
ASC(60,58,95,61,95,61,41)
ASC(192,32,179,32,217)

Attachments

Login to view attachments
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 10th Dec 2008 03:15 Edited at: 10th Dec 2008 03:16
Quote: "edit: hmmm, what about zipped files?"

RAR is just another kind of ZIP (not technically but conceptually it would seem so). They both compress stuff into one file . So, ZIP would work too. With this format people wouldn't have to do as much to play the game, and so, as AndrewT pointed out, you would probably get more reviews.

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 12th Dec 2008 04:37
Alright then here's the zipped file enjoy

ASC(32,95,179,95,218)
ASC(60,58,95,61,95,61,41)
ASC(192,32,179,32,217)

Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th Dec 2008 06:48
Zip RULES RAR is lame LOL .... ARJ was the best but somehow didnt catch on ... LOL

So I grabbed your zip.. but the EXE is not in the same dir as the media (and didn't on its own try to get to the media folder)... so I moved the EXE to the folder with the sprites.. and it worked...

Interesting. Keep at it.. you have a ways to go but what you have is the beginning of "getting it" so hang in and make some more leaps and bounds and let us know

--Jason

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 20th Dec 2008 22:59 Edited at: 20th Dec 2008 23:01
I've updated the file some:
better camera and press "d" to kill yourself
wont be able to do much else until after Christmas
@Jason: thanks

32,95,179,95,218
60,58,95,61,95,61,41
192,32,179,32,217

Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 21st Dec 2008 22:13 Edited at: 21st Dec 2008 22:42
Hey ive come to a problem that i cant fix.



I tried to make it so when u die, you cant move and rotate the character. DarkBasic seems to igore those commands and does it anyway. Also it wont reset the position when u die. Help is appreciated

Also ive posted the exe with the media -->

edit: oh and you kill yourself with your shurikens

32,95,179,95,218
60,58,95,61,95,61,41
192,32,179,32,217

Attachments

Login to view attachments
Violent Pigeon
16
Years of Service
User Offline
Joined: 30th Dec 2007
Location: London, Great Britain
Posted: 26th Dec 2008 01:52
Quote: "ip RULES RAR is lame LOL .... ARJ was the best but somehow didnt catch on ... LOL
"


WinRAR it has WIN in it for a reason

also, 7Zip is a good preference normally, everything opens it and it super compresses stuff more than anything I have ever seen.



Not_Maindric
17
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 26th Dec 2008 20:28
Interesting, I tried it and only found one glitch. If you throw a shurikin when you are holding up and left, it travels with you, if you move left and throw, it goes faster...

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 18:50
Oh, that's because when you are jumping and moving, you go faster than just moving because you're not constantly slowing down from hitting the floor.

Thanks for checking it out.

32,95,179,95,218
60,58,95,61,95,61,41
192,32,179,32,217
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 21:03
I've come into a little problem with the sprite collision command. I'm using it to register floors and such but it'll work for a second then the character will start floating, as i've commanded that when the character hits the floor the y value will lesseen a bit. It appears that it won't refresh the sprite collision status or something. Any suggestions? heres a pic



Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 21:12
And heres the latest .exe if you want to try it out yourself. Just jum around for a little and it'll happen

p.s. just a little off topic but how do i add a picture to my signiture?



Attachments

Login to view attachments
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 21:14
Hmm....

Well the pic doesn't help me but I THINK your ISSUE might be that your collision "flag" internally isn't being reset?

I ALWAYS place print statements as "watches" on screen to show the status of "toublesome things" so I can see them and often this helps me figure out what's going on. Like for example place a constant refresh (checking the sprite collision on various sprites your concerned with) on screen. Make sure not to dupe yourself by calling the command twice though - I mean...

MySpriteColValue01 = SpriteCollision function here
MySpriteColValue02 = Another SpriteCollision function here

Then print these values ... THEN use these same variables for your code to react to... don't call the collision function two times - one to print results and another for your code to react to cuz you're displaying the wrong info even if its right 99% of the time.

Also for the 2d tiling type games - many people actually use the screen or a "separate image" (a two color image) of the level.. and where the sprite moves... they look in the image to see what the color is - if the color is "floor" than that serves as their collision... if the color isn't... then woo hoo - air time!

You can make this technique even facier having different colors for elevators, swamps, etc etc.

--Jason

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 21:18
(host the pic somewhere - then link it to your sig)

I had to experiment with mine alot - but this finally worked:



(Hope that shows as code LOL)

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 21:45 Edited at: 2nd Jan 2009 21:46
hmm, well it seems to work now that i assigned the collision function to a variable rather than just checked the conditional statement directly with the function. thanks Jason tho im not quite sure how to do the color check thing you were talkin about

Also, i cant load a pic to my sig by doin (img)mydocs/pic.jpeg(/img) or sometin?



jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 21:50
No - but you can upload your pic here - in a post, then when viewing that pic afterwards just viewing the post - you can right click and copy the linkn - and use that in your sig. Just don't get to big for a pic or you might get some feathers ruffled.

--Jason

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 22:01 Edited at: 2nd Jan 2009 22:48
k lemme try

Attachments

Login to view attachments
Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 22:03 Edited at: 2nd Jan 2009 22:49
lets see if it worked.....


YES!!! you are awesome jason
not much of a sig yet but ima work on it in photoshop

edit: made a better one, now to get back to the task at hand

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 2nd Jan 2009 23:16
hmm is it possible to create one image for a level turn it into a sprite then use the sprite hit command to register the floor without darkbasic ignoring the command because the character is already inside the sprite? or do i have to make a seperate sprite for every floor?

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 2nd Jan 2009 23:55
LOL - your welcome.

Not Sure about the sprite question. However this reminds me of stuff I did on a commodore 64 back in the '80s LOL.

Now those pc's had 64k of Ram... (16 commodore 64's had 1 meg of RAM! and some of that was not exactly usuable!)

So the point is that this sort of thing was done in machine code to be fast enough to be bearable - and the technique used for this sort of thing was actually done in the 6502 processor - sprite collision was actually built in - but the method it used internally was boolean math.. basically - along the lines of what I said about having an image that represents you level and checking the colors.

Imagine taking a black and white picture .. just a black square on a white background. Now place another (black) square overlapped onto the first square EXCEPT as you place it - every dot that is touching the first square gets toggled to white.

Then you scan the second squares pixels - if the color is not what it was prior to touching the first square (black) then you have a collision. This is an example of pixel perfect collision and might be a bit much using the tools at your disposal however this technique ... or the variation of it I mentioned previously is probably more efficient than trying to make a full screen sized sprite and expecting dbpro/gdk to handle the pixel collision like that.

I guess this post doesn't help much - except to try and get you to think out of the box to accomplish the same thing you want from collisions. Collision could literally be accomplished for "ground" by loading a black-white image of your level... black floor, white air, make memblock from the image. Now the first 12 bytes of that image with be three sets of 4 bytes - 3 numbers - dwords - they used 4 bytes each - 1 is image width, 2nd= height, 3rd is bit depth. After that you have an array of DWORDS - each DWORD has four bytes - RED,GREEN,BLUE,ALPHA. Starting at the point your sprite is, go suth the distance to sprites feet. then from there... start going down scanning this memblock for value of ZERO - say in the red channel (the byte in the pixel that represents RED) if its not zero - its not a collision... if it is ZERO - you have the height of the ground - and the distance from your sprite to the ground and you can adjust from there.

pseudo:

Get PIXEL from Memblock created from image:

iOffset = 12+ ((XPixel + (YPixel * ImageWidth))*4)

MyDword = Memblock Dword Get (MemblockId, iOffset)

------------

Just want individual color channels? I forget the byte order - but...

MyByte0 = Memblock Byte Get (MemblockId, iOffset)
MyByte1 = Memblock Byte Get (MemblockId, iOffset+1)
MyByte2 = Memblock Byte Get (MemblockId, iOffset+2)
MyByte3 = Memblock Byte Get (MemblockId, iOffset+3)

Hope this is helpful.

--Jason

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 3rd Jan 2009 18:07
Hmm... it'll take me a little time to play around with the concept but.... I will understand this!... eventually

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 18:55
The complicated line I basically wrote for you.

1: Make Memblock from Image? EZ.. Load an image and then call the MAKE IMAGE FROM MEMBLOCK command. You end up with a memblock with picture data in it. You CAN if you want delete the image at this point... Or use that "ID" for another image later or whatever.

2: A memblock is JUST a long list of bytes.... number's between 0-255. That's IT! Now because there are different kinds of numbers: Bytes, Integers, Words, DWORD's.. which all have their own ranges... Some kinds of numbers need more BYTES EACH... So... Look at this:

1 byte = Value: 0-255
2 bytes = word = Value 0-65535
4 bytes = dword = 2 words = Value 0-4294967295

Now - it just so happens that in BINARY... you need 8 digits to count up to 255. (Look at the byte value range) so 1 Byte has 8bits in it. Now when you hear about 32bit this or that - a DWORD is a 32bit value

(32bit) floats are the same size as a DWORD but the numbers are stored differently so the whole floating point decimal thing.

Ok... SO you can have a memblock, a series of bytes. If you want to store numbers that need more space each, than you have to "SKIP" Around the memory block ....

Example... 2 store TWO DWORDS in a memblock ... I might make a memblock that is 8 BYTES long! Memblock size = 8. Position (offset) ZERO will hold the FIRST 4 byte number(DWORD), Position (offset) 4 is where I'd stuff the next 4 byte number (DWORD)... Now even though I stored TWO NUMBERS - those NUMBERS (DWORDS) at 4 bytes each = total 8 bytes = means I FILED my 8BYTE memblock.

Get it?

Ok... back to the IMAGE being in the memblock... The first THREE DWORDS are:

offset (position) 0: Image Width
offset (position) 4: Image Height
offset (position) 8: Bit Depth (Ignore for now)

Now the REST of the memblock is full of PIXELS!!! Colorful little DOTS MAN!

Each Pixel uses four bytes! One for Red, one for Blue, One for Green, one for ALPHA (255=visible, 128=50% transparent, 0=invisible)

So... To play with the color of the TOP MOST LEFT MOST pixel - the first pixel... you need to play with the first PIXEL located just after those first 12 bytes reserved for image width, height, bit depth. (Position 12)... (Now look up at my previous post where there is the +12 bit...

Now I forget the exact order... but if the first pixel is at postion 12, and we know each pixel is four bytes - then...

OFFSET 12 - Red
OFFSET 13 - Green
OFFSET 14 - Blue
OFFSET 15 - Alpha

(I forget which is truly red,green,blue, alpha - but play around - you'll get it... start filling em with 255's and then you should definately get a white dot)

So the Math... in the line iOffset = 12+ ((XPixel + (YPixel * ImageWidth))*4) makes a little sense.

first we skip past the header (12 byte) then we use the rest of the math to get us to the offset of a particular pixel... remember its a grid... X across, y down - X = Columns, Y = rows. Each pixel is 4bytes - thats why the *4 is in there.

Each row has as many pixels as the image is wide. To skip a row - you add (4*ImageWidth) to your offset - that is skip imagewidth number of pixels with regards to fact that each pixel is four bytes long.

I hope this helps shed some light on matters for you. Remember to google forums and internet at large to learn more ... there are code snippets of people manipulating images directly in memory...

Have fun - keep at it.

--Jason

Databug
15
Years of Service
User Offline
Joined: 27th Oct 2008
Location: Elsewhere
Posted: 3rd Jan 2009 19:49 Edited at: 3rd Jan 2009 20:26
Thanks man, that explains a lot.

edit: Whoo!!!!!!! i loaded an image and turned some of the pixels white! yay, im understanding this

oh and btw
offset 12 = blue
offset 13 = green
offset 14 = red
offset 15 = alpha

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2009 20:31
YOU ROCK - now when you get that DOWN... You can "PEEK" at what color a pixel is... for the collision stuff we were dicussing. If the Sprite "Y" position PLUS the SPRITE HEIGHT... is where your feet are... Then you look at that pixel in the memblock to see what the color is... if the color is "AIR" - you're in the Air... if the Color is "FLOOR" color = then well.. LOL ... I'm really happy you are starting to make sense of all this... a friend calls it "GOO"

Login to post a reply

Server time is: 2024-09-28 00:16:21
Your offset time is: 2024-09-28 00:16:21