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 / stopping a sprite when it hits a sprite?

Author
Message
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 17th Jan 2006 00:25 Edited at: 17th Jan 2006 00:28
yo.
i was wondering, cause i have my character sprite and my tile sprite.
if there was a way when the character (sprite 1) collided with the tile (sprite 3)
the character(sprite1) stops. does anyone know how to do this? thanks,

-Snowfall

[edit] here is my source if you want it:
[/edit]

smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 17th Jan 2006 10:44
basically u need to use

so just change the star bit to like "x#=x#+movespeed#" if moving left
and "x#=x#-movespeed#" if moving right

so all in all it'll look like this

place that just before
Quote: "`Position monster
sprite 2,mx#,my#,2"
and it should be good.

life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 17th Jan 2006 18:56 Edited at: 17th Jan 2006 20:22
Sweeet! thank you so much smallg!

[edit] How do i make it so when he is not ontop of a block he goes back to the ground?

here is my source:



please help me. once again. i want to make him go back to the ground if he is not ontop of a tile

[href]http://snowfall.homestead.com [/href]
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 17th Jan 2006 22:20
you will need something like;

but this will likely have trouble with this code;

because as soon as you move it up, the collision will be zero therefore you will get a jumping/jerking movement.....

therefore i suggest using something more like;


i also noticed u've used
Quote: "if upkey()=1 then move sprite 1,33"

this really could be changed to
to make it fit in better.

hope that helps a little...

life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 17th Jan 2006 22:33 Edited at: 17th Jan 2006 22:37
dude you rock. but for some reason it says:

"Sprite number must be greater than 0 at line 128"

here is screenshot:



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

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

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


do you think you could put your stuff into my code? Please bro

thank you so much for helping me with my problems in my code. you rock!
this is what i need now. please help

-=Snowfall Studios=-

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

Attachments

Login to view attachments
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 18th Jan 2006 15:03
finally managed to actually run your code..... after about 30 mins trying to uninstall and then reinstall dbpro, only because i found your images under the other thread.

and this is what i have come up with...


***note***
looks as though u can't jump but you can!
u have to be touching the wall to jump though, a shame but i need to work on it. also i noticed your hero needs to have a little bit of his back shaved off, as he seems to walk too far along the walls before he falls off.


do u want people to be able to jump over the enemies aswell?

anyway, i know dark lord is helping u do this so i didn't want to do it for him so as not to confuse u aswell.

p.s. is the attached file for me? what is it?

life's one big game
Acolyte Entertainment
19
Years of Service
User Offline
Joined: 28th Dec 2004
Location: Oregon, US
Posted: 18th Jan 2006 16:27
no the attached file was a screeny

[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 16:28
this is da code i have so far:


darklord is helping to but if you wanna pitch in thatd be great. we are facing the issue of
not being about to move ontop of the brick. you can download my media from the other thread if you want

[href]http://snowfall.homestead.com [/href]
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 18th Jan 2006 21:52 Edited at: 18th Jan 2006 22:16
ok, i'll run it now....
btw, did u try my code?

update....

here u go, am i good or what??? lol


this works fine, for me anyway

edit number 2...
keep me posted, this is looking good, i'll look forward to playing this in the near future... (if ur kind enough to share it of course, lol) and if u want any help just ask, i'm enjoying having something to work on.

life's one big game
Dark Lord
19
Years of Service
User Offline
Joined: 19th Aug 2005
Location: Australia
Posted: 19th Jan 2006 00:06 Edited at: 19th Jan 2006 00:09
Hi, smallg and Snowfall Studios

Impressive except there is just one problem : sometimes is allows you to walk through the wall - or mabey thats just DarkBasic Classic.

Check out what Snowfall and I have been working on here, mabey you can help us fix it:
http://forum.thegamecreators.com/?m=forum_view&t=69842&b=7

Once you have jumping and collision done your game is almost finished - I think they are the hardest parts.
smallg
Valued Member
18
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 19th Jan 2006 11:30
hi darklord.... will come/add to the other thread, so this one is done.
if anyone would like to post please follow the link above to post.

life's one big game

Login to post a reply

Server time is: 2024-11-27 07:51:25
Your offset time is: 2024-11-27 07:51:25