1.In the create event of the object, put this code:
In the step event of the object, put this code:
That is a simple movement code.
2. Depends? What do you mean, you could, in the create event of the object, put:
in the step:
3.question 1...
4.RTSM (read the stupid manual)
IT says:
| | |
| Quote: draw_healthbar(x1,y1,x2,y2,amount,backcol,mincol,maxcol,direction,showback,showborder) With this function you can draw a healthbar (or any other bar that indicates some value, like e.g. the damage). The arguments x1, y1, x2 and y2 indicate the total area for the bar. amount indicates the percentage of the bar that must be filled (must lie between 0 and 100). backcol is the color of the background for the bar. mincol and maxcol indicate the color when the amount is 0 and 100 respectively. For an amount in between the color is interpolated. So you can easily make a bar that goes e.g. from green to red. The direction is the direction in which the bar is drawn. 0 indicates that the bar is anchored at the left, 1 at the right, 2 at the top and 3 at the bottom. Finally showback indicates whether a background box must be shown and showborder indicated whether the box and bar should have a black border line. | |
| | |
put that in the draw event (that is the health)
With the lives... Thats a bit more complicated...
ok... change the '50's to a bigger, or smaller number. That is what changes how far in from the top left of your screen it is. The first 50 being how far from the left, the second is how far from the top. the 16 is how far apart they should be. sprite0 should be replaced by the name of the sprite you use as lives (hearts, etc.).
5.Do you mean, that you run the game, and you can draw the level then?
That is a lot more complicated then you think... You will have all sorts of problems, mainly through speed, but you can create a round sprite, around 32x32.
Then create an object with that sprite. Call this object obj_drawn
then create an object, called obj_control, in the LMB event, have:
Then you have a level drawn, but it will make the game lag. I did it before, but can't remember exactly how i did it and it required quite a bit of code.
6.Create a new sound, call it snd_music
check the background option...
create an object, call it obj_music, in its create event, put this code:
7.Woow, if you can't do the stuff above, AI is totally out of your realm. AI is dependant on the type of game. So i can't give you code. Instead i will give you the idea...
Take the coordinates of the CPU, and the coordinates of its enemy. Basically the CPU should do something about the enemy, so if its a platform type of game for example, you should check if its enemy is above it, and then it should jump, also checking though, if the floor is below it. If its enemy is right near it, make it attack, etc. Basically get a full idea of its surroundings, and make it act accordingly. For a good AI, a lot of code is needed.