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 / 2D jumping? iv searched just cant get it implemented

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 17th Jan 2006 23:22
does anyone know of a jumping code that would work for my game:




if so i would be ever so greatfull if you could implement it

thank you for your time
-=Snowfall Studios=-

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 18th Jan 2006 00:48 Edited at: 18th Jan 2006 00:55
This is a small example of jumping which you should be able to implement in your code:



I know it doesn't have proper physics but it works and runs under DarkBasic Classic + only took me about five min to make . Just update your player sprite instead of drawing a box.

[edit] Sorry I didn't read the title of the thread . Can you please post your images and then I might be able to implement jumping into your code?
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 00:59
I use DBPRO. but here are the images:

[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 18th Jan 2006 01:26 Edited at: 18th Jan 2006 02:41
I use DarkBasic Classic but your code looks pretty compatable, i'll see what I can do.

[edit] Still working on it, I fixed the lag problem.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 02:12
cool thanks

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 18th Jan 2006 04:32
I have to go out now but I think I almost have it.

Here is my code so far ( I retyped it so I could focus on the jumping ):



I'll do some more when I get back.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 04:50 Edited at: 18th Jan 2006 05:19
Sweet! this rocks! now all we need is collision from the side =D

[edit] okay this is what i got :
now we need collision on the side of the brick. (think of me as your partner ) thank you so much for doing this Dark Lord! [/edit]
[edit2] (PS. all that i added to your code was to mirror the sprite when turned left and right and add collision to edges of the screen)[/edit2]
[edit3] what i was thinking for side collision was
but it scoots the player off the block so that doesent work [/edit3]
[edit4] im getting 32 FPS on this machine. (and my comp is no joke)[/edit4]
[edit5] ROFL! i just took off
and i got 1434 FPS. LOL [/edit5]

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 18th Jan 2006 08:03 Edited at: 18th Jan 2006 11:34
Quote: "`set tile collision from sides
if sprite collision(1,3)
if flip# = 1 then x#=x#+5
if flip# = 0 then x#=x#-5
endif"
- It's never that easy , but don't worry I am trying to uncover a calculation which will handle side collision separately.

[edit] I'm stuffed there must be an easier way if I could get those oldx# and oldy# variables working properly. I'll keep trying, anyway if worse comes to worse we can use the collision we already have + front, and side collision.

[edit2] I think this one is the best so far but now I have to implement correct collision for the top of the box:


[edit3]
Here is the latest code, it all works fine except for one error - try jumping onto the top of the box and then not pressing any keys for a few seconds:


Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 18th Jan 2006 08:58 Edited at: 18th Jan 2006 08:59
nvm... accidental double post
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 15:49
yeah thats odd.

[href]http://snowfall.homestead.com [/href]
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 15:49 Edited at: 18th Jan 2006 16:17
sorry. miss post. i was gonna say this worked:



but then you run up the side of the brick

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 00:23
Try running this and reading the text on-screen:


Control is passing to the wrong points in the if statement - but I can't see why.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 01:30 Edited at: 19th Jan 2006 01:49
hmmm thats really odd!

[Edit] okay this is what i got: its attached in zip. its pretty rad![/Edit]

[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 02:19 Edited at: 19th Jan 2006 02:25
I get a 'Could not load image at line 25 error'. Are you sure you put all the media in the same folder as your code uses?

[edit] For the time being lets just use source code ok?
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 03:28 Edited at: 19th Jan 2006 03:36
kk. here is what i got


[href]http://snowfall.homestead.com [/href]
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 05:43 Edited at: 19th Jan 2006 05:44
Dark Lord. here is a pic of the current game:



[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 05:49
But does the box collision and jumping work properly?
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 06:08
yeah but there is no collision from the sides of the boxes.
i just thought of it and it doesent make any since to have collision
on the sides. Cause if we do that then the player cant navigate
and in real life you could probably go behind that pile of bricks.

-=Snowfall Studios=-

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 06:17
Oh well I guess that fixes the problem .
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 06:23 Edited at: 19th Jan 2006 06:24
hehe. here is updated screeny:



[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 06:25 Edited at: 19th Jan 2006 06:26
Dark Lord here is updated media and the EXE: Unzip the file before using the EXE.

[edit] Also after getting the new media set up here is the source if you want it:
enjoy! [/edit]

[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 06:36 Edited at: 19th Jan 2006 07:07
Thanks, I am downloading it now.

[edit] Good work on the game ! If you want I can add a level or two?

Good luck!
Shadowed Lightning
19
Years of Service
User Offline
Joined: 10th Nov 2004
Location:
Posted: 19th Jan 2006 09:28
Good work SnowFall I've been playing around with it, and for a smoother jump instead of y# = 30 or whatever u have you could put grav# = grav# + 10 but then you can jump in mid air so youd have to make some extra variables so you couldn't do that but just a suggestion.
My fps was 1619

AMD Athlon 64 3200 - GeForce 6800 GT - 320GB Hard Drive
1024MB RAM
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jan 2006 11:26
latest update from me,
added moving rats and improved tile collision slightly


life's one big game
Shadowed Lightning
19
Years of Service
User Offline
Joined: 10th Nov 2004
Location:
Posted: 19th Jan 2006 11:31
Don't forget to give us the rat image...

AMD Athlon 64 3200 - GeForce 6800 GT - 320GB Hard Drive
1024MB RAM
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jan 2006 13:46 Edited at: 19th Jan 2006 15:36
@ shadowed lightning ... it was already included in the download above ^^^
quote from snowfall studios
Quote: "Dark Lord here is updated media and the EXE: Unzip the file before using the EXE"

it's 3mb.... so i will include only the required media here, therefore u don't need to download the file above.

this time i added mana recharge and an upgrade to shoot a force blast thing...


**edit** sorry the file i included is a .zip file (16kb) not 3mb (that's the one above) so anyone with dial-up can download aswell.
happy gaming guys...

**edit** just updated pro to version 5.9 and quess what... it had bugs, lol, so i have changed the code again.... not that anyone noticed.

life's one big game

Attachments

Login to view attachments
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 16:01
hehe. Swweet code smallg! thats rad. think you could rem it out a bit more and explain it?
everyone! feel free to add on!

[href]http://snowfall.homestead.com [/href]
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 19th Jan 2006 16:16 Edited at: 19th Jan 2006 16:41
Dark and smallg i added a pause menu. hit escape to view. feel free to add more levels or code!
its open

[edit]smallg. i have tried to make it so when you hit return (at the end of level 1)
then it goes to level 2 (a main loop of printing stuff) but it just freazes.
any ideas how we can acomplish this? [/edit]

[edit2] i got it. i hadent put a sync there on the 2nd level[/edit2]

[href]http://snowfall.homestead.com [/href]
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jan 2006 18:15
where is the updated code?

life's one big game
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 23:57 Edited at: 19th Jan 2006 23:58
Its been good helping but i'll have to leave now as I only have DarkBasic Classic and there is too much converting to be done for me.

I hope you get the game finished and I see it on the WIP boards some day .
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 00:29 Edited at: 20th Jan 2006 00:32
here is updated code:


Darklord i would love for you to stay but if you must you can leave

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 20th Jan 2006 00:45
I wont go if thats what you mean , but I may not be on as frequently. [Tip] Make yourself a neat level editor with DarkBasic Pro or Visual Basic and edit the game so it loads a level and plays it from a .pak file or something.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 01:17 Edited at: 20th Jan 2006 01:37
smallg. i think our next priority should be to make it so when the force blast
hits the rat then the rats health goes down and it prints the rats health over the rat.

then there comes more levels
you rock bro!

-=Snowfall=-

[edit] Dark Lord if i knew how to do that i would do it in a gif [/edit]

[2edit] here is da updated code:
cheers! [/edit2]


[href]http://snowfall.homestead.com [/href]
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 03:33 Edited at: 20th Jan 2006 03:38
Smallg. i added a ton! including some target practice to get some things movin
if you like it please comment. I added some new sprites so make sure to download the zip.

here is code once you get the new sprite (i included all my sprites im using and an EXE)




DONT USE THAT DOWNLOAD IT IS THE WRONG FILE. Use the following download on next post (sorry )

[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 03:37 Edited at: 20th Jan 2006 04:20
here is real download

[edit] hey smallg. i added a start menu (really basic) and fixed some glitches and added a death sentance MUAHAHAHAHA (in other words you can die :
enjoy! [/edit]

[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 20th Jan 2006 05:00
Nice progress on the game. To save yourselves alot of time I advise using the same main loop for all the levels.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 05:33 Edited at: 20th Jan 2006 06:26
Wouldent that be hard with all the differences in the levels?

[EDIT] here is the new game: i added new intro and its really coming along! here is source if you want:


and you can get download with EXE and media below: [/EDIT]


[href]http://snowfall.homestead.com [/href]

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 20th Jan 2006 10:35 Edited at: 20th Jan 2006 10:58
Quote: "Wouldent that be hard with all the differences in the levels?"
- Use arrays to store the object numbers of walls etc.
during the game check for the collision somehow like this:


[edit] Actually if you want I could start working on a level editor and help you implement it in your game, saves you having to 'hard code' all those levels?
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 16:10
Dark - if you can get a level editor up and running and find a way to get collision and special effects into my game. your my hero bro!
hard coding all the levels isnt the easist thing

[href]http://snowfall.homestead.com [/href]
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 20th Jan 2006 19:06 Edited at: 20th Jan 2006 20:38
ok, looking good, what's the big eye thing for (in lvl 2)?

adding updates.... including potion to restore health and some corrections.

ok, here's the latest update.....


life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 20th Jan 2006 22:53 Edited at: 21st Jan 2006 00:13
dude why did you take the target out? you are supposed to shoot the target. then it brings down the platform

[edit] okay well. You are supposed to shoot the targets. here is current source (i added another level and mana potions):



[/edit]

[href]http://snowfall.homestead.com [/href]
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 20th Jan 2006 23:51 Edited at: 20th Jan 2006 23:59
It makes designing the level editor easier if we decide which screen resolution we are going to use now. Is it ok if we use 800x600x32 which as far as I know would be what the game currently uses anyway?

[edit] Actually dont worry I will just use the default resolution.
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 21st Jan 2006 00:14
yeah i dont care what rez is. as long as its not to small or big. current is perfect.

[href]http://snowfall.homestead.com [/href]
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 21st Jan 2006 01:27 Edited at: 21st Jan 2006 03:57
Okay guys! i added some cool armor sprites and some other nick nacks. here is the source:



you can download EXE,sprites,tracks and images below:

Attachments

Login to view attachments
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 21st Jan 2006 04:58
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 23rd Jan 2006 17:14
lol, i thought is was a big eye thing, not a target.....
well nevermind then, looks nice, i need the code for this level editor please dark, then i can update the rat movements.

life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 24th Jan 2006 02:10 Edited at: 24th Jan 2006 02:58
Yo. for some reason the forums whernt working for me lately. well. i added A TON! here is source:



Download new media (there is a new type of eye thing (it teleports you)

EXE and media is attached:

[EDIT] Dark could we have level editor code? [/EDIT]

[EDIT2] Okay now the hardest part of all. we have to get a save function in when you click on the save button. that will be RAD. [/EXIT2]

Attachments

Login to view attachments
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 24th Jan 2006 10:35 Edited at: 24th Jan 2006 11:04
yeah the forums were offline for a bit

looks great, few mistakes though...

1. u obviously forgot to take out your testing code as u start at level 3, lol, need to remove the "goto level3_setup"

2. the player is facing backwards all the time, u need to set flip#=0 when u define all the other variables.

3. it asks for the players name, why can't u use it as the hero's name?
like this....

so now when u see the intro it calls him the players name... ok so long as they are a man, lol, maybe u could let them choose their gender before they start?

4. how do u finish level 3?
i got both targets and all the second one does is move the block up a tiny bit, maybe it's meant to go up a little more?
the only way i found was to get stuck in the wall (without shooting the second target) and then magically walk through it and fall onto the exit, lol.

btw nice amour upgrade, works very well.
also like the admin thing, hard pasword too, lol.

keep up the good work.

life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 24th Jan 2006 16:43
thanks. first things first:

1: sorry forgot to take that out
2: the reason the player was facing backwards was becuase it jumped to level 3 and was flipped twice
4: to get threw level 3 you need to shoot through the wall and hit the target then the platform moves.
5 $ 6 thanks for compliments =D

-=Snowfall=-

UFO
18
Years of Service
User Offline
Joined: 11th Oct 2005
Location:
Posted: 24th Jan 2006 22:55 Edited at: 24th Jan 2006 22:59
That was pretty cool. The jumping is a little fast though. Also, you need to fix the player direction ALso, you might want to change the transporter image because it looks like lava, and it took me a while to see what it really was.


Hippopotomonstrosesquippedaliophobia-Fear of long words

Login to post a reply

Server time is: 2024-09-24 17:36:37
Your offset time is: 2024-09-24 17:36:37