| |
Need help with GML collision code
Tek |
|

no
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif)

Group: Members
Posts: 4393
Member No.: 1734
Joined: 17-December 05
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
I'm having a bit of trouble with this code. It works fine, except when you try to jump while moving into a wall. It doesn't let you jump. Code for collision with wall/floor/ceiling object:
| CODE | if place_meeting(x,y+abs(vspeed),block) { move_contact_all(270,8.5) vspeed = 0 if jumpindex != "crouch" jumpindex = "stand" } if place_meeting(x,y-abs(vspeed),block) { move_contact_all(90,8.5) vspeed = 0 } if place_meeting(x+hspeed,y,block) { move_contact_all(direction,5) hspeed = 0 } |
I'm using just one object as the wall, floor, and ceiling. The jumpindex bit isn't important- that just stops you from getting out of crouch mode when you're on the ground
This post has been edited by Tek on Apr 5 2009, 11:02 PM
--------------------
|
|
|
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
[ Script Execution time: 0.0473 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 1.24 ]
| |