Soccer Extension, In other words, Problem 6.1

March 24, 2006 at 3:51 am (Game Maker, Uncategorized)

This Blog is about how to make the problem 6 easier to understand, and easier to shoot for goal. Using this kind of configuration is slightly easier, and allows you to do more.

(This first object is to sit there and do nothing, except cause the ball to bounce back to the start.)


Sprite: sprWall

Solid: true
Visible: true
Depth: 0
Persistent: false
Parent:
Mask:
(this next object does everything, making it do everything, jump to the start etc. You'll see)

Sprite: sprball

Solid: false
Visible: true
Depth: 0
Persistent: false
Parent:
Mask:

(This event is a long winded event, which is to make sure that if the ball leaves via a particular way, which is up in this one, the points go up by 1)

Step Event:

if expression y smallerthan 0 is true

jump to the start position

start moving in directions 000010000 with speed set to 0

set the score relative to 1

(This event is to make the ball bounce against walls)

Collision Event with object objWall:

bounce precisely against solid objects

(This event is to make sure that the ball doesn't cause points to pile up [ie give lots of point for nothing] when the ball goes outside via the north ( y smallerthan 0 ) and to get the ball back at the beginning when the ball is out the room)

Other Event: Outside Room:

start moving in directions 000010000 with speed set to 0

jump to the start position

(The following events are to enable two types of shooting for goal when you press either the 8 button or the 5 button on the keypad [NUMLOCk off!]. The one with the numbers 60+random(60) is called "accurate shooting" and has a narrow shooting range[60 degrees]. The other one is called "sloppy shooting" and has a wide shooting range [90 degrees])

Key Press Event for Keypad 5 Key:

if expression speed=0 is true

set speed to 5 and direction to 45+random(90)

Key Press Event for Keypad 8 Key:

if expression speed=0 is true

set speed to 10 and direction to 60+random(60)

Also, If you're looking for apicture of this in action, view my older post, Problem 6.

this whole problem was easy, with the help of the sheet that the teach. gave me. So, tehnically the teach. helped me. 

Advertisements

1 Comment

  1. Bill Kerr said,

    i love the way in which you have indented your code for the if statements – please explain your technique to me!!!

    your commentary shows you understand all the issues

    how about help?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: