| |
Help with pushing blocks
Ndsfreak |
|

Who wants a body massage?
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Sprite Comp Runner Up Badge (1) [*]](https://archive.mfgg.net/html/badges/scr1.gif) ![Sprite Comp Top 5 Badge (3) [*]](https://archive.mfgg.net/html/badges/sct3.gif) ![Secret Santa Badge [*]](https://archive.mfgg.net/html/badges/present.gif)

Group: Members
Posts: 1993
Member No.: 2868
Joined: 28-October 06
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Here is the code.
| CODE | { if place_meeting(bbox_left-1,y,obj_block_solid) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1; if place_meeting(bbox_left-1,y,obj_block_jumpthrough) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1; if place_meeting(bbox_left-1,y,obj_block_ice) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1;}} }
|
Its for GM7.
It gives me this error.
| QUOTE | ___________________________________________ FATAL ERROR in action number 2 of Keyboard Event for <Left> Key for object obj_player:
COMPILATION ERROR in code action Error in code at line 33:
at position 1: Symbol } expected.
|
Hlep, please?
This post has been edited by ndsfreak on Sep 6 2007, 09:12 PM
--------------------
|
|
|
exenefevex |
|
Regular
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif) ![Minigame Comp Winner Badge (1) [*]](https://archive.mfgg.net/html/badges/mcg1.gif) ![Secret Santa Badge [*]](https://archive.mfgg.net/html/badges/present.gif)

Group: Members
Posts: 258
Member No.: 3660
Joined: 19-April 07
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
I count four open brackets. I've got as much GM experience as DJ Yoshiman, but I think you simply forgot to close your first two else blocks.
CODE (oops... I can't use size tags inside a code block) { if place_meeting(bbox_left-1,y,obj_block_solid) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1;}} if place_meeting(bbox_left-1,y,obj_block_jumpthrough) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1;}} if place_meeting(bbox_left-1,y,obj_block_ice) {exit;} rneighboor=noone; lneighboor=instance_position(bbox_left-1,y+16,box); if lneighboor=noone {x-=4; image_single=0;} else {if lneighboor.lmove {lneighboor.x-=4; x-=4; image_single=1;}} }
Never rely on the compiler to tell you where your brackets are missing. If you had placed }}}} on line 33, the compiler would have run the code... and who knows what would have happened next. :P
This post has been edited by xn--e5x on Sep 6 2007, 11:33 PM
|
|
|
Bormogin |
|
Standard Member
![Super Happy Heart Badge [*]](https://archive.mfgg.net/html/badges/shappyheart.gif)

Group: Members
Posts: 3195
Member No.: 1844
Joined: 29-January 06
Status: (0d)
![[--]](style_images/mfgg2_skin/warn_nosuspend.gif)

|
Let's try a little experiment here:
Hopefully this will be a little easier than codes and scripts,
1. For the character: Keyboard Left, If object "insert object" is at a postion, If sprite index "insert left sprite", then play sound "..."
(Have the character press left against the block, and play a sound)
(If you do not want a sound, you could lower the volume)
2. For the block: Collision with character or Step: if sound is playing, if sprite_index "object character", then move "insert point" relative.
(Define the sprite of the character and have the sound play, and move the block forward)
-------------------
When you release the key, stop the "sound"
--------------------
Super Mario IV: Vendetta of the Guillotine Mask is now permanently cancelled. I may start a new project.
|
|
|
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.0909 ] [ 14 queries used ] [ GZIP Enabled ] [ Server Load: 1.56 ]
| |