Problem 12

For problem 12, I spoke to Mr Crosby and we agreed that my fully completed game would be fine as far as problem 12 goes =)

I won’t bother explaining how I made my game as it’d take an incredibly long time, not to mention an extremely long blog.

Problem 11

11) Push a rock

firstly, you need to sprite/objects: 1 for the pusher and 1 for the rock. They can be any objects really, but it would be good to for the rock to resemble a rock or ‘dot’.

This will help you move the pusher, or just use the skills challenge 3. Either way, your pusher just needs to be able to move:

The next step is to make objects for all the sprites. For the “object character” put in the “character” in the sprite and check the solid box. Go “Add Event” and choose keyboard left make x: -5 and for y keep it zero then check relative. Then go “Add Event” then choose keyboard up and for y: -5 and for x keep it zero and check relative, then press ok. Go “Add Event” and choose keyboard then choose right then in x: 5 and in y keep it zero, check relative and press ok. Finally go to “Add Event” and go to keyboard then choose down and make y: 5 and keep x zero, check relative and press ok.

Next you have to make an object for the “Stone.” Put in “stone” in the sprite and tick solid. Go to “Add Event” and choose the “Collision” event then put in the “Object Character.” For its actions put in “If a position is collision free.” This can be found in the control tab. Make x: 32 and keep y: 0 next put in Objects: only solid check relative and press ok. The next action you have to put in is the “jump to given position” which can be found in the move tab. When the box appears change x to 32 and keep y: 0 then check relative and press ok.

Now we have to “Add Room.” Make the grid 32 by 32 and put in the character and two stones. Then press the green arrow and try it out!

———

Evidently, I copied this from Mr Crosby’s blog – however, when I did it myself I used “5″ instead of “32″ to give the pushing a more natural look. I also programmed the character’s movement differently, as displayed in all my other blogs.

Problem 10

A character jumps up off a platform, and return under the influence of gravity – you cannot jump from midair.

Information about object: obj_kirby

Sprite: kirby_still

Solid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Create Event:

snap position to a grid with cells of 32 by 32 pixels

Alarm Event for alarm 0:

start moving in directions 000010000 with speed set to 0

Step Event:

COMMENT: Check whether in the air

for all obj_kirby: if relative position (0,1) is collision free for Only solid objects

for all obj_kirby: set the gravity to 0.5 in direction 270

else

for all obj_kirby: set the gravity to 0 in direction 270

COMMENT: Limit the vertical speed

if vspeed is larger than 12

for all obj_kirby: set variable vspeed to 12

Collision Event with object obj_wall:

set the vertical speed to 0

set the gravity to 0 in direction 0

Collision Event with object obj_bigboss1:

set the health relative to -10

if direction is larger than 180

move relative to position (50,0)

Keyboard Event for <Shift> Key:

go to next room with transition effect <no effect>

Keyboard Event for <Down> Key:

start moving in directions 010000000 with speed set to 4

Key Press Event for <Space> Key:

if sprite_index is equal to Kirby_Right

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 1

if sprite_index is equal to kirby_left

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 180

if sprite_index is equal to kirby_still

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 1

Key Press Event for <Left> Key:

start moving in directions 000100000 with speed set to 4

set the sprite to kirby_left with subimage 0 and speed 1

Key Press Event for <Up> Key:

if relative position (0,1) gives a collision with Only solid objects

set the vertical speed to -15

Key Press Event for <Right> Key:

start moving in directions 000001000 with speed set to 4

set the sprite to Kirby_Right with subimage 0 and speed 1

Key Release Event for <Left> Key:

start moving in directions 000010000 with speed set to 0

set the sprite to kirby_still with subimage 0 and speed 1

Key Release Event for <Right> Key:

start moving in directions 000010000 with speed set to 0

set the sprite to kirby_still with subimage 0 and speed 1

Key Release Event for <Down> Key:

start moving in directions 000010000 with speed set to 0

____________________________________________________

Problem 9

Load a character sprite and a bullet sprite.

Add an object and use the bullet sprite. Click on add event, create. Drag the red arrows, under the move tab, into the action section. When the popup appears, click only the up arrow. Type how fast you want the bullet to go in the speed section.

Add another object and use the character sprite. Click on add event, create. Drag set the value of a variable, under the control tab, into the action section. When the popup appears, type canshoot into the variable section. Also, type 1 into the value section.

Click on add an event, keypress, space. Drag if a variable has a value, under the control tab, into the action section. When the popup appears, type canshoot into the variable section. Type 1 into the value section, and select equals to in the operation section.

Drag both start and end of block, under the control tab, into the action section. In between them, drag create instance of an object. When the popup appears, select the bullet object in the object section, and click the relative box.

Also between the blocks, drag set the value of a variable. When the popup appears, type canshoot in the variable section, and 0 in the value section.

Also between the blocks, drag set an alarm clock, under the main2 tab. When the popup appears, type 30 in the number of steps. and press ok.

Click on add an event, alarm0. Drag set the value of a variable, under the control tab, into the action section. Type canshoot in the variable section, and 1 in the value section.

Test this by putting the character in a room, and pressing space. You should only be able to shoot a bullet every second.

(Taken from Pikmik’s blog)

I also used the 1945 tutorial to complete this task.
For Mr Crosby’s benefit, this is the only problem not within my Kirby game.

Problem 8

You have to hit a character 3 times with a bullet before it dies.

I did this a bit differently than what we were probably supposed to. Rather than using lives, I made several duplicate objects of the enemy and merely had it change the instance when it was hit – except for the last one, where I destroyed the instance.

______________________________________________________Information about object: obj_bigboss1

Sprite: spr_bigbossSolid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Create Event:start moving in directions 000101000 with speed set to 4

display message: Oh no! It’s the boss of Candy Land’s rivals, the King of Broccoli Land! Shoot him three times to win the game. Watch out for the enemies he releases and the bombs he fires.

Step Event:with a chance of 1 out of 60 do perform the next action

create instance of object obj_bigbossbomb at relative position (0,0) with speed 4 in direction random(360)

with a chance of 1 out of 120 do perform the next action

create instance of object obj_enemybossrelease at relative position (random(room_width),random(room_height)) with speed 4 in direction 0

Collision Event with object obj_kirby:bounce not precisely against all objects

Collision Event with object obj_wall:bounce not precisely against all objects

Collision Event with object obj_kirbyfire:change the instance into object obj_bigboss2, not performing events

______________________________________________________

______________________________________________________Information about object: obj_bigboss2

Sprite: spr_bigbossSolid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Create Event:start moving in directions 000101000 with speed set to 4

Step Event:with a chance of 1 out of 60 do perform the next action

create instance of object obj_bigbossbomb at relative position (0,0) with speed 4 in direction random(360)

with a chance of 1 out of 120 do perform the next action

create instance of object obj_enemybossrelease at relative position (random(room_width),random(room_height)) with speed 4 in direction 0

Collision Event with object obj_kirby:bounce not precisely against all objects

Collision Event with object obj_wall:bounce not precisely against all objects

Collision Event with object obj_kirbyfire:change the instance into object obj_bigboss3, not performing events

______________________________________________________

Information about object: obj_bigboss3Sprite: spr_bigbossSolid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Create Event:start moving in directions 000101000 with speed set to 4

Step Event:with a chance of 1 out of 60 do perform the next action

create instance of object obj_bigbossbomb at relative position (0,0) with speed 4 in direction random(360)

with a chance of 1 out of 120 do perform the next action

create instance of object obj_enemybossrelease at relative position (random(room_width),random(room_height)) with speed 4 in direction 0

Collision Event with object obj_kirby:bounce not precisely against all objects

Collision Event with object obj_wall:bounce not precisely against all objects

Collision Event with object obj_kirbyfire:destroy the instance

go to room room7 with transition effect <no effect>

______________________________________________________

______________________________________________________Information about object: obj_kirbyfire

Sprite: spr_bulletSolid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Collision Event with object obj_wall:destroy the instance

Collision Event with object obj_bigboss1:destroy the instance

Collision Event with object obj_bigboss2:destroy the instance

Collision Event with object obj_bigboss3:destroy the instance

______________________________________________________

Information about object: obj_kirbySprite: kirby_stillSolid: false

Visible: true

Depth: 0

Persistent: false

Parent: <no parent>

Mask: <same as sprite>

Create Event:snap position to a grid with cells of 32 by 32 pixels

Alarm Event for alarm 0:start moving in directions 000010000 with speed set to 0

Step Event:COMMENT: Check whether in the air

for all obj_kirby: if relative position (0,1) is collision free for Only solid objects

for all obj_kirby: set the gravity to 0.5 in direction 270

else

for all obj_kirby: set the gravity to 0 in direction 270

COMMENT: Limit the vertical speed

if vspeed is larger than 12

for all obj_kirby: set variable vspeed to 12

Collision Event with object obj_wall:set the vertical speed to 0

set the gravity to 0 in direction 0

Collision Event with object obj_bigboss1:set the health relative to -10

if direction is larger than 180

move relative to position (50,0)

Keyboard Event for <Shift> Key:go to next room with transition effect <no effect>

Keyboard Event for <Down> Key:start moving in directions 010000000 with speed set to 4

Key Press Event for <Space> Key:if sprite_index is equal to Kirby_Right

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 1

if sprite_index is equal to kirby_left

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 180

if sprite_index is equal to kirby_still

create instance of object obj_kirbyfire at relative position (1,1) with speed 12 in direction 1

Key Press Event for <Left> Key:start moving in directions 000100000 with speed set to 4

set the sprite to kirby_left with subimage 0 and speed 1

Key Press Event for <Up> Key:if relative position (0,1) gives a collision with Only solid objects

set the vertical speed to -15

Key Press Event for <Right> Key:start moving in directions 000001000 with speed set to 4

set the sprite to Kirby_Right with subimage 0 and speed 1

Key Release Event for <Left> Key:start moving in directions 000010000 with speed set to 0

set the sprite to kirby_still with subimage 0 and speed 1

Key Release Event for <Right> Key:start moving in directions 000010000 with speed set to 0

set the sprite to kirby_still with subimage 0 and speed 1

Key Release Event for <Down> Key:start moving in directions 000010000 with speed set to 0

______________________________________________________

Problem 6

A ball goes through a goal and the score goes up by one… the score does not go up if the ball misses the goal.

You will need a sprite for the goals and one for the ball. In my case, I also made a sprite for the shooter. This is optional. You can program it so the ball is shot when the player hits space bar, but I decided to make it shoot when the character collides with it. It would also be a good idea to have a background with a soccer pitch or something, but it’s up to you.

Create an object with the ball as the sprite. Do the following:

Information about object: obj_ballSprite: spr_ball
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>
Collision Event with object obj_soccerkirby:
set speed to 8 and direction to -80+random(100)
Other Event: Outside Room:
jump to the start position
start moving in direction -> stop -> speed set to 0

Create an object out of the goals. Complete the following:

Information about object: obj_goal

Sprite: spr_goals
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Create Event:
display message: You have 30 seconds to score as many goals as you can for points. Run Kirby into the ball to shoot the goal.
Collision Event with object obj_ball:
set the score relative to 25
for other object: jump to the start position
for other object: start moving in direction -> stop -> speed set to 0
for all obj_soccerkirby: jump to the start position

Create an object out of the shooter sprite. Complete the following: (this is more complex than most of you will need – I simply duplicated the main kirby character from my main game and deleted the actions which didn’t need to apply)

Information about object: obj_soccerkirby

Sprite: kirby_still
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: <no parent>
Mask: <same as sprite>

Collision Event with object obj_ball:
jump to the start position
Keyboard Event for <Down> Key:
start moving in direction -> down -> speed set to 4
Key Press Event for <Left> Key:
start moving in direction -> left -> speed set to 4
set the sprite to kirby_left with subimage 0 and speed 1
Key Press Event for <Up> Key:
start moving in direction -> up -> speed set to 4
Key Press Event for <Right> Key:
start moving in direction -> Right -> speed set to 4
set the sprite to Kirby_Right with subimage 0 and speed 1
Key Release Event for <Left> Key:
start moving in direction -> stop -> speed set to 0
set the sprite to kirby_still with subimage 0 and speed 1
Key Release Event for <Up> Key:
start moving in direction -> stop -> speed set to 0
Key Release Event for <Right> Key:
start moving in direction -> stop -> speed set to 0
set the sprite to kirby_still with subimage 0 and speed 1
Key Release Event for <Down> Key:
start moving in direction -> stop -> speed set to 0

Put all your objects into a room – make sure the start position of the shooter is not far from the start position of the ball. Make sure the ball is directly (horizontally) opposite the goals. This way you can ensure that the shooter is trying to shoot the ball to the right, which is the direction it has programmed if you followed these instructions.

For Mr Crosby: this solution can be found in the second level (room2) of my game “kirby.gm6″

Skills Challenge 6

Problem 5

Make one object follow another object.

Make two sprites for two different objects. In my case, I used the first skills challenge so I had one object that already had movement. Create the second object with the other sprite.
Go add event -> step -> step
Drag “Move in the direction of a point” into actions. In the x coordinate, enter obj_appleball1.x (or replace obj_appleball1 with whatever you named the object you want this one to follow), in the y enter the obj name again plus .y
Make the speed the same as what the leader object’s speed was (in my case, 2).

I did more to this as part of the game, but this is all you need to make an object follow another.
I got help from Pinkus on this one – he told me what to enter in the coordinates.

Mr Crosby: This can be found in the fourth level (room 4) of my game “kirby.gm6″

Skills challenge 5

Problem 4

When a bullet hits a character, the character explodes and the explosion then disappears.

First of all, you need to have completed problem 3 to complete this task so you don’t need to make a character that fires the bullet.

Now, create a sprite of an enemy. Also create an animated (it must be animated!) sprite of an explosion. Create an object and use the explosion sprite as the sprite.
Go add event -> other -> animation end
Then drag “destroy the instance” into the actions section. That’s all you need to do for this one. Click okay.

Create an object and use the enemy sprite as the sprite.
go add event -> collision -> obj_kirby
Drag “change the instance” from the main1 tab into actions.
Drag “destroy the instance” from the main1 tab into actions.
And that’s all you need! You can also make the enemy move and cause damage if the character hits it and things of that nature, but as far as the skills challenge goes, this is all you need to do.

I didn’t need help for this one because I had done something similar while completing the 1945 tutorial.

For Mr Crosby: This solution can be found in level one, level three and level five (aka rooms 1, 3 and 5) of my game “kirby.gm6″

Skills Challenge 4

Problem Three

A character can move left and right with arrow keys (you have to keep pressing the key for it to keep moving) and fires a single bullet forward when you press space bar. You have to release and press space bar again for more bullets.

Because of how I wanted the character to move in my game, I did this challenge a fair bit differently to what most may have done. My way is more complicated, but looks more polished.

First off, I needed four sprites. One of my character (kirby) standing still, one of an animation of kirby running to the left, one of an animation of kirby running right and finally a bullet sprite.

Add an object and use the bullet as the sprite. Call it obj_kirbyfire. If you have walls in your game, all you need to do for this is go add event -> collision and select the wall object. Drag the “destroy the instance” (with “self” checked) from the Main1 tab into the actions section. That’s all you need for this.

Add an object and use the sprite of kirby standing still. Name it something like “obj_kirby” (how original).
First off, go add event -> key press -> left.
Drag the red arrows into the actions section. Click the left arrow only. Set the speed to about 4. Click okay.
Next, drag the “Change the Sprite” option from the main1 tab. Check “self”, select the sprite of the animation moving to the left , set the subimage to 0 and speed to 1. Click okay.
Once you’ve done that, go add event -> key release -> left.
Drag the red arrows into the actions section and click only the stop. Click okay. Drag the “change the sprite” function and check “self”, select the still sprite, set the subimage to 0 and the speed to 1.

Basically, do this in reverse for the right.

Now, to make the character shoot you need to do the following:
add event -> key press -> space
Drag “If a variable has a value” into the actions menu. Write the variable as sprite_index the value to Kirby_Right (or whatever you named the sprite that moves right) and operation equal to.
Then drag “create an instance of an object with motion”. Set the object as obj_kirbyfire, the x as 1, the y as 1, the speed as 12 and the direction as 1. Check relative.
Drag “If a variable has a value” again. Write the variable as sprite_index the value to kirby_left (or whatever you named the sprite that moves left) and operation equal to.
Then drag “create an instance of an object with motion” again. Set the object as obj_kirbyfire, the x as 1, the y as 1, the speed as 12 and the direction as 180. Check relative.
Finally, drag “If a variable has a value” again. Write the variable as sprite_index the value to kirby_still (or whatever you named the sprite stays still) and operation equal to.
Then drag “create an instance of an object with motion”. Set the object as obj_kirbyfire, the x as 1, the y as 1, the speed as 12 and the direction as 1. Check relative.
And you’re done! Add your character to a room to try it out.

I got help from Pinkus for how to fire the bullet in the right direction in relation to where the character is moving.

Mr Crosby – this solution can be seen in any level of my game “kirby.gm6″ where the character of kirby is present.

Skills Challenge three

Problem Two Part B

Make an animation from a strip sheet of stills.

b) another where the slides are of varying sizes (harder).

Go into add -> add a sprite -> edit a sprite -> file -> create from strip.
Open the strip sheet you wish to use the images from.
Select the LONGEST and WIDEST picture from those that are to be included in the animation. It is important that you make sure it is the largest. If the longest is not also the widest, simply move the box temporarily to adjust the width before moving it back to the longest.
Adjust the image width and height accordingly.
Click okay.

Go file -> add from strip and load the same strip sheet.
Add the rest of the images.

When you have added all of the images, they will be out of sequence. To move them into the correct order, simply click on the image you need to move and use the blue arrows (“move image to the left” and “move image to the right”) on the toolbar to rearrange them.

Again, if after turning the sprite into an object and testing it in a room, it moves to fast, then use the animation -> stretch option from the edit sprite screen.

Mr Crosby – this can be found on the file “shadowjump.gif” in my “Strips” folder within my “Gamemaker” folder.

I have not included a thumbnail, once again, owing to wordpress not looping them correctly.

« Older entries
Follow

Get every new post delivered to your Inbox.