Game Maker Community YoYo Games

Welcome Guest ( Log In | Register )

> Novice Forum Rules

Novice and intermediate users who are using Drag & Drop action icons, or still learning GML, can get help from more experienced members.

Please READ the Novice Q&A Forum Rules prior to posting. And remember that the General GMC Rules apply here too.

 
Reply to this topicStart new topic
Catching Fire =d
randomman159
post Nov 3 2009, 08:45 AM
Post #1


R159PRODUCTIONS.TK
Group Icon

Group: GMC Member
Posts: 130
Joined: 19-July 09
Member No.: 136725



I have a 'flaming box'. When a part of the flame (using a ps) touches the normal box, i want the normal boxes variable (nofire) to go down by 1.
Can anyone help me acheive this?
Go to the top of the page
 
+Quote Post
randomman159
post Nov 3 2009, 09:49 AM
Post #2


R159PRODUCTIONS.TK
Group Icon

Group: GMC Member
Posts: 130
Joined: 19-July 09
Member No.: 136725



I also want obj_enemy to set alarm[0] to 5 if it touches fire.
Go to the top of the page
 
+Quote Post
Drivinucrazy Gam...
post Nov 3 2009, 07:03 PM
Post #3


Pendulum Fan
Group Icon

Group: GMC Member
Posts: 69
Joined: 12-May 08
From: My house in CANADA!
Member No.: 106818



Well, if you're using a particle system for the fire, you can't do collisions with particles, so use objects for the fire or a special bounding box instead.
Go to the top of the page
 
+Quote Post
Schyler
post Nov 3 2009, 07:19 PM
Post #4


GML Educator
Group Icon

Group: GMC Member
Posts: 2392
Joined: 19-July 06
From: Australia GMT+10:00
Member No.: 55111



How thick is the fire? You could get away with an area check...?
Go to the top of the page
 
+Quote Post
randomman159
post Nov 3 2009, 08:09 PM
Post #5


R159PRODUCTIONS.TK
Group Icon

Group: GMC Member
Posts: 130
Joined: 19-July 09
Member No.: 136725



not really... The fire sort of 'burns' away the object (just a sprite slowly burning from the top) and as it burns down, the fire area shrinks as well. (to make it more realistic)
Go to the top of the page
 
+Quote Post
Schyler
post Nov 3 2009, 09:30 PM
Post #6


GML Educator
Group Icon

Group: GMC Member
Posts: 2392
Joined: 19-July 06
From: Australia GMT+10:00
Member No.: 55111



Well, in that case, I don't have the GameMaker manual on me but If I remember correctly there aren't any ways to check for particle collisions unless you use an (emitter, transformer? - check the particles tutorial on YoYo Games, it has an example) and detect when the particle kinds change.

Alternatively, if lag is not a problem, using objects would most likely be much easier.

Regards,
-Schyler-
Go to the top of the page
 
+Quote Post
randomman159
post Nov 4 2009, 04:24 AM
Post #7


R159PRODUCTIONS.TK
Group Icon

Group: GMC Member
Posts: 130
Joined: 19-July 09
Member No.: 136725



Ok i will check...

Any other ways though?
Go to the top of the page
 
+Quote Post
Salmonman
post Nov 4 2009, 04:35 AM
Post #8


GMC Member
Group Icon

Group: GMC Member
Posts: 374
Joined: 10-May 09
Member No.: 133134



You could use screen_save() to record a particle system and animate it into a sprite. That what i do. Then you can have a collision and no lag. You could also formulate your own particle system and add in collisions, but you might not want to go that far.
Go to the top of the page
 
+Quote Post
randomman159
post Nov 4 2009, 05:37 AM
Post #9


R159PRODUCTIONS.TK
Group Icon

Group: GMC Member
Posts: 130
Joined: 19-July 09
Member No.: 136725



ok... i tried using collision rectangle... I don't know why it isn't working:

CODE
if collision_rectangle(x-16,flametop,x+16,y,obj_block,0,0)<0
{
    other.nofire-=1
}

if collision_rectangle(x-16,flametop,x+16,y,obj_enemy,0,0)<0
{
        other.life-=1
}



could anyone help?
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd November 2009 - 10:40 AM