I have a jumping game because I have recently started a project on a platformer type game, because of the kool things I saw in the post Jumping where blanius and others showed how to make a character jump.
I Have a problem though. Sence I'm using a box code from connelete, whenever my character colides with the platforums he stops and cant go through it because its a box code. This code worked great when I had a small character (a ball) in which when I started out my project. But now that I created a larger character (a blue creature), he is too big that he colides with the platforums causeing him to stop even if he isnt on top of the platforum. So to resolve this, I created some boots for the character called body, and the boots are called "guy". and they do all of the moving, because they are small and wont ram into platforms above them. Now that I have the boots moving/jumping/stoping when landing on the floor or platforums, how do I get the main part of the character called "body" to follow the boots so it moves everywhere the boots moves? If you can help me get this to work, my guy wont stop when he collides with platforms above him.
Heres the source, play it in your browser and you will see what I want you to do.
but there is still one problem. After you get the first 3 stars, the 3 new platforms and stars pop up. Jump onto the second platform. Then hold the left arrow so the guy keeps moving left. Sence the body part is working with the box code he stops and doesnt fall.... Thats why i need the body to ONLY fallow the boots so that the body doesnt interact with the platforms and cause the character to completely stop.
first can I suggest replacing my box code with my box function? It makes it simpilar. Um if I get your question, your saying when your guy collides with above platforms it cant even move at all. I suggest taking ym box function and removing the parts that stop you from colliding left right or bottom, that way you only wont fall through the platforms but can still go through them left or right and jump up through them. Kinda confusing but I can try and explain it more if you dont get it.
well the thing is I only used the code for the BoxBottom that you made up for the platforms I used are just lines.... I didnt create whole boxes so I thought that code would work. I didnt use the WHOLE box code I just used the code for the BoxBottom element. But the problem is my character is to big so maybe I have to space out the platforms more? I dont know but what you were saying before I dont think thats an issue because i didnt use a code for the Boxleft and Box Right in which you created.
um well its in the function, it works so it stops you only if youve colided with it and are moving towards that direction. If I get rid of the left right and bottom then you can only land on the platform, like I said let me wokr with it and check back this time tommarow.
alright thanks tons, cause I couldnt figure out how to get the function although I just realized the reason why its not working is because I used the boxbottom code when I should be using the BoxTop code that you made, but im sure their is some bug in that so Ill just check back this time tommorow like you said.
OK, I modified it so that the boots have soles and all collisions are checking the soles and not the boots (the soles are just lines on the bottom of the boots). I also made a change to the "end script" because when the score hit 30 it went to level2 which is fine but it would kept doing this because the score stayed at 30. So I put a stop in the script to prevent this from happening and level2 seems to work.
hey I looked at your movie and I dont really have time to mess with it, but if you look at the example I attached you'll see how that specific box function would make your game easier to make and faster running. Just put the function in the starting script and have another script running everyframe saying root.box(element1,box). Ofcourse replace element1 with your guy and box with the particular platform. That way youll just have one script with a few lines of code instead of those huge complex box scripts. Take a look at the movie, also I edited the function to not have left right or bottom so it can go through the box unless its on top of it.
alright sweet! Thanks ppedz for the modified file, it worked great! And it solved all of the problems I've had so far.
And connelete, i checked out the boxthing and It sure seemed easier than the way I'm doing things
I think I get it, but sence I would have to use the code for multiple platforms, how would I do so? would I just use the same function code and keep using it for all of my platforms (switching the platform names), then place the code in the starting script? Or is their another way to do it just using the one function?
edit:
I cant figure out how to get the fuction working
I put it in my starting script and replaced the function to (guy,BoxBottom), and put in the script which called the guy element1 and boxbottom box. I still can't get it to work however, It says that the code getbounds() wasnt working and my element guy is a layer but that shouldnt hurt anything.
you dont replace it in the starting script, if you look in the example that I posted theres a script running every frame saying root.box(element "dude", element "box"). You leave the function as it is with the names and by running the root.box it runs the function "box" and replaces the element 1 and box with element "dude", element "box". Basically dont change the funtion and just make a script run everyframe saying
root.box(element "dude", element "platform 1")
root.box(element "dude", element "platform 2")
root.box(element "dude", element "platform 3")
etc....
the reason its easier is because you just have to say root.box etc and it runs the whole function without you having to copy it. You DONT have to change the function. If you do it wont work. Get it?
oooooooooooooooo alright i understand now... Boy! that seems way easier, thanks for the tips but I have to go so I wont be able to really try it out until tommorow most likely.
alright i applied the new changed and recieved the following error:
function box(element1,box) was given 4 parameters when 2 were expected
function box(element1,box) was given 4 parameters when 2 were expected
function box(element1,box) was given 4 parameters when 2 were expected
Do you know what the problem is?
Somethings not right. The reason why the errors came up was, i believe, because I had assigned to many elements to the box function.
1. did you say root.box(etc)?
2. You cant say root.box(element guy, element plat1, element plat2) you have to say
root.box(element guy, element plat1)
root.box(element guy, element plat2)
3. You can use use movies or layers, it has to be a direct paint or bitmap I think.
ok so wait, what about etc? Is that part of the code?
I noticed you said to put that a few times but I thought u literally meant etc.... But how would i write root.box etc as an actually code? How to i incorporate "etc" into the code because i didnt so that must be the problem
ok so wait, what about etc? Is that part of the code?
I noticed you said to put that a few times but I thought u literally meant etc.... But how would i write root.box etc as an actually code? How to i incorporate "etc" into the code because i didnt so that must be the problem
I believe etc is used here as a placeholder, not something you would type.
Jeffrey Davis (3DFA user since 2.x... or was it 3.x?) (Yes, I finally reveal the offline identity of JSDvs9172, being myself of course. Oh, and sorry for stealing your signature idea, blanius, which I see you stopped using.)