******

Post your own tutorials, guides and demos.

Post » Thu Jun 19, 2008 7:01 pm

Locate the "always" under the comment "dead".

Right click the event, and add a subevent.

step1: object = Head
Step2: condition = Object is outside layout

finish

Add an action to that.
And just copy the action where we set Player_is in the "start layout"
Change "alive" to "dead" in the action.

*lazy editing* : )

Select the sub event "is outside layout" (E-spot) .. CTRL+c, CTRL+v to duplicate it.

Double click the condition to edit it.

click one step back.

step1: object = Head
step2: condition = is overlapping another object
step3: parameters: object = body

finish

Run all.

uh oh .. problem.
The snake does not move no more.

ALWAYS when you add a collision detection, Run the events.
To see if the Collision Method needs adjustments.


Go to the layout editor.
And change the collision method for each Body to "point"

double click the "always" condition that starts the dead events to edit it

step2: condition is compare.
step3: parameters / value 1 = Vault.Value('X_head') + Vault.Value('Y_head') / comparison = different to / value 2 = 0

finish

Copy this condition also under the every 100 milliseconds event.
This event will have 2 conditions then ..
The every, the flow alive, and this event that holds the events till player input



Run again, and now the snake moves again.
B
3
S
2
G
4
Posts: 322
Reputation: 2,119

Post » Thu Jun 19, 2008 8:04 pm

Select the "is global variable" condition under the "every 100"
press CTRL + c
select the last "always" condition
press CTRL +v

change the "alive" in the condition to "dead"

Cant be easier.
Another side effect of using this method is ....
you force yourself to make a mental snapshot of the context that we used this global variable in ..
by scrolling back to it, to copy it.
The story of game, the flow, stays fresh in your mind.

delete the always in that event.

Now go to the layout editor. Add a new layer on top.
Select the layer on top.

add a sprite "02.png" from the oopz folder
place it in the middle of the layout.
toggle its properties "Invisible on start" (under appereance)
Name it Oopz

Bring up the Animation organizer on the right.
Change "default" in "idle"
Right click an empty spot in the upper part of the organizer.
choose "add new animation" from context menu
Name the animation "over"
The animation, not the angle thingy

a name is a properties, and those u change on the left .. member ?

select the angle under "over"

In the frame portion of the organize you see the number 1
But there is no sprite/frame yet.
Right click the "1" ...
choose "import frames"

only import the 01.png from the oopz folder.

Back to the events editor.

Add a sub event to the last event (is global variable = dead)

step1: object = mouse and keyboard
step2: condition = mouse is over object
step2: object = Oopz

finish

add a new action to this.

step1: self = Oopz
step2: action = Set animation
step3: name = "over" (including the "'s)

finish


Duplicate that EVENT.
Right click the CONDITION in that event .. and invert condition

change the "over" in the duplicated action to "idle"

Copy the first sub event (the not inverted one)

double click the condition of the copy to edit it

one step back

step2: condition = On object clicked
step3: parameters: button = left / type = clicked / object = Oopz

finish

delete the action is there because of the copy.

Add a new action to it.

step1: object = Oopz
step2: action = set visible
step3: parameters = Invisible.

finish

CTRL+c, CTRL+v (copy) this event.

In the first one ...

double click the condition.
click 2 times back

step1: object = system object
step2: condition = Trigger once while true

finish

double click the action to change invisible to visible.

Add another action to the previous event, the "on left clicked event"

step1: system object
step2: action = Go to layout
step3: parameters: layout = "layout 1" (including "'s) / transition = none / duration = 200

Why duration ?
Often if the layout has a big "on layout start event", it will crash if you keep the duration on zero.
A none zero duration, till even 1000 or 2000 when the "on layout start" event includes loops,
will prevent this crash.
B
3
S
2
G
4
Posts: 322
Reputation: 2,119

Post » Thu Jun 19, 2008 8:31 pm





...
B
3
S
2
G
4
Posts: 322
Reputation: 2,119

Post » Wed Jul 02, 2008 1:16 pm

tags: basic c0nstuct

(just for me to find my *tuts* back)
B
3
S
2
G
4
Posts: 322
Reputation: 2,119

Post » Mon Jul 07, 2008 4:50 pm

Very VERY impressive work with this tutorial.

This should be moved to the documentation project page right now instead of being lost in then infinite amount of "how do you create a mario game?"-kind of questions posted here.
B
8
S
2
G
5
Posts: 744
Reputation: 3,288

Post » Mon Jul 07, 2008 4:52 pm

Agreed, I moved it :)
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Mon Jul 07, 2008 5:06 pm

thats only 1 in a series of 3 (so far)

the others are here.

search.php?keywords=beginners+tags
B
3
S
2
G
4
Posts: 322
Reputation: 2,119

Post » Mon Oct 19, 2009 4:52 pm

weird. i cant see any images in here. :?
B
2
G
3
Posts: 4
Reputation: 858

Post » Mon Oct 19, 2009 4:53 pm

This thread is very old and the OP's host is probably now offline.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Mon Oct 19, 2009 7:25 pm

sorry to drag back a zombie thread from the grave then. ^_^
i didnt even check the dates. its just that the thread looked so damned constructive.
B
2
G
3
Posts: 4
Reputation: 858

Previous

Return to Your tutorials & example files

Who is online

Users browsing this forum: No registered users and 0 guests