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.

Author
Message
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 3rd Apr 2003 09:54 Edited at: 3rd Apr 2003 18:23
Could someone have a look at my code and tell me why my player object falls through the floor???


thanks in advance

'You were born crying while people around you smiled'
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 3rd Apr 2003 17:34
instead of

position object 2000,x#,y#,z#

try

if y#>2.5
position object 2000,x#,y#,z#
else
position object 2000,x#,2.5,z#
grav#=0
endif

this will make it so you're player will only fall when he is above the ground...i havn't tested it but i think it will work...hope it helps...

Anyone Can Destroy...But Few Can Create...
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 3rd Apr 2003 18:24
that kinda works, it think there might be an easier way, also using that method i can't move left and right when i'm on the ground, thats probably something to do with the collision.

'You were born crying while people around you smiled'
GameKit
21
Years of Service
User Offline
Joined: 6th Mar 2003
Location: USA, Staring Blankly at a Computer
Posted: 3rd Apr 2003 23:46
hmmm... mabey, replace the

if y#>2.5
position object 2000,x#,y#,z#
else
position object 2000,x#,2.5,z#
grav#=0
endif

with

if y#>2.5
position object 2000,object position x(2000),y#,object position z(2000)
else
position object 2000,object position x(2000),2.5,object position z(2000)
grav#=0
endif

...i think this will make it so they will still move too...

Anyone Can Destroy...But Few Can Create...
ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 4th Apr 2003 19:09
that doesn't seem to make much difference, also as my level has other objects/platforms in it, just specifying one height still leaves me with the problem of what to do with the other platforms

'You were born crying while people around you smiled'
AnalSauceMonkey
22
Years of Service
User Offline
Joined: 24th Oct 2002
Location: I can't find myself
Posted: 5th Apr 2003 03:02
This is a kind of messed up, but I changed a little and made this. It doesn't move on the floor right, though. (This game looks very similar to the way I made some of my 20 liners.)
You're using DBClassic, right?



ReD_eYe
21
Years of Service
User Offline
Joined: 9th Mar 2003
Location: United Kingdom
Posted: 5th Apr 2003 10:18
i am using db classic. i decided to try and use and understand some of the code in the 20 line games i just couldn't get jumping and collisions right, it probably was your 20 line game that i used for reference.
thanks

'You were born crying while people around you smiled'
Danmatsuma
21
Years of Service
User Offline
Joined: 2nd Mar 2003
Location: Australia
Posted: 5th Apr 2003 20:15
why not check out the sliding collision example in the help files, does what you need

ZX Spectrum 48k Issue 3, Radio shack Tape drive, Rank arena 12" T.V. set.

Login to post a reply

Server time is: 2024-11-24 08:25:41
Your offset time is: 2024-11-24 08:25:41