安装 Steam
登录
|
语言
繁體中文(繁体中文)
日本語(日语)
한국어(韩语)
ไทย(泰语)
български(保加利亚语)
Čeština(捷克语)
Dansk(丹麦语)
Deutsch(德语)
English(英语)
Español-España(西班牙语 - 西班牙)
Español - Latinoamérica(西班牙语 - 拉丁美洲)
Ελληνικά(希腊语)
Français(法语)
Italiano(意大利语)
Bahasa Indonesia(印度尼西亚语)
Magyar(匈牙利语)
Nederlands(荷兰语)
Norsk(挪威语)
Polski(波兰语)
Português(葡萄牙语 - 葡萄牙)
Português-Brasil(葡萄牙语 - 巴西)
Română(罗马尼亚语)
Русский(俄语)
Suomi(芬兰语)
Svenska(瑞典语)
Türkçe(土耳其语)
Tiếng Việt(越南语)
Українська(乌克兰语)
报告翻译问题




Well there are multiple ways to do this but what you can do is check for a collision with the player. If the collision is true check if the player is above below to the left or right of the object, then move the obj by 1 in the opposite direction until collision = false (I'd also have a counter so if it loops through the code more than a few times it breaks from the loop) you could do a similar thing for the maze walls to keep it from being pushed into them. There is probably a better way to do it though.
or
Put this little guy in the collision event (exe piece of code) in BOTH objects...
x += 0.1*(x-(other.x))
y += 0.1*(y-(other.y))
small code can do wonders, tweak as needed...
to answer you question you need to create 3 things.
1 - your sprite
2 - an object that your sprite can attach to
3 - a room in which your object can be place.
A sprite is the image that you want to show the player of your game - this could be a character.
An Object will hold all the functions. You attach the Sprite to the object so that the player can see what the object represents. For example: If you want to create a wall. You would create a sprite, and within this sprite, you would draw a wall. Next you would create a new object (and call it wall) and attach the sprite to this object so the player can see it is a wall. You would then add the functions that make the wall a wall, such as a collision to stop other objects passing through it.
Next you need to create a room, from here you can place the Wall Object anywhere you like within the room while essentially makes the levels.
Generally you want to name everything the same, but with a 'title' so you know which 'wall' is an object or a sprite.
sprites are typically titles spr. So for a wall, you should call the:
Sprite 'spr_wall'
Object 'obj_wall'
Room 'rm_level_1'
Remember, the reason room isn't entitled 'Wall' is because this is where all the wall objects are places to make a level.
These rooms can also be used for other things such as introductions, title pages etc. The room is what the player is presented with when they load the game.
There's a tone of tutorials on Youtube and on GameMaker, check them out sometime.