Help with zombie type game.

Get help using Construct 2

Post » Thu Jan 05, 2012 12:00 am

I'm trying, I put like this:

Sprite4 (Zombie) On collision with Sprite2 (Player)
    (Sub Event)-----Every 1.0 seconds: Sprite2 Subtract 10 from HealthPLayer
B
4
G
1
Posts: 16
Reputation: 607

Post » Thu Jan 05, 2012 12:35 am

This would never work

A collision check is a kind of condition called trigger.
Triggers are instantaneous conditions, they are true "at the moment" if sprite4 collides, it's true and then false even if sprite4 still overlaps sprite 2

Maybe you'll notice you have an "is overlapping condition?" :D
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Jan 05, 2012 12:40 am

@Cookies1304
If your zombie have an attack animation, this method is better:
1. Condition:
-Zombie Is overlapping Player
Action:
->Set Zombie animation to "attack animation"

2. Condition:
-Zombie On animation "attack animation" finished
-Zombie Is overlapping Player
Action:
->Subtract 10 from HealthPlayer
->Set Zombie animation to "default animation"

B
34
S
8
G
5
Posts: 174
Reputation: 5,791

Post » Thu Jan 05, 2012 1:14 am

Well guys, I tried the overlapping, but I'm not using any animations, but it's still the same, he just takes 10hpp when he get close, and only takes another 10 if I back off and he gets closer... :(
B
4
G
1
Posts: 16
Reputation: 607

Post » Thu Jan 05, 2012 1:55 am

[QUOTE=Kyatric] [QUOTE=Urled] That solution is not an acceptable solution,.[/QUOTE]

@Urled: how so ?
Please explain yourself.
As far as I'm aware, this is a perfectly well-fit solution to use in C2.
[/QUOTE]

it's cause every second works with the system timer, so really, this is going to look kind of stupid and cheap if you shoot, because sometimes itll take one second to fire a first shot, or some times itll take an instant.

what needs to be done is

Always:

>subtract from gun('timer') : TimeDelta

On Space pressed:
& gun variable 'timer' less or equal 0

>spawn object bullet.
set gun('timer') to 1

this will make it so your gun can only shoot every second, but it will also make it so that if a second has passed since your last shot, the first shot will come out instantly as expected

something like this is usually ideal for a On hit Reloading type timerQuaziGNRLnose2012-01-05 02:06:11
B
52
S
7
G
6
Posts: 1,945
Reputation: 7,610

Post » Thu Jan 05, 2012 2:58 am

Acceptable Zombie

The "every X seconds" event looks acceptable to me nevertheless.

But I see your point now, considering the complexity/level of realism you want to achieve one solution might be favorised over the other.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Jan 05, 2012 6:33 pm

Thx, I'll try that .capx later, I'm using construct v73, and my internet sucks, so, I'll download the 74 later.

Now this one I'm really stuck: I'm trying to make a "Die" animation to the zombie, but it plays just too fast, I use:

-Set Animation to "Die" (From beginning)
-Set animation speed to 1
-Set animation frame to 1
-Destroy

Extra: Does anyone knows a good program to make nice 8-bit characters and animations? Thx
B
4
G
1
Posts: 16
Reputation: 607

Post » Thu Jan 05, 2012 8:05 pm

As a newcommer, your first reflex should really be to check out the manual first when you have trouble. (Or clicking the Help links within C2).

In this article you can read:

Speed The number of animation frames shown per second. For example, if set to 5, each animation frame lasts for 1/5th of a second. Set to 0 if you do not want the animation to play (e.g. if a tile set is used with a different tile in each frame).

Which means, the closer you get to 0, the slower your animation plays.
And also you don't need to set it from events at runtime, you can very well define this property once and for all in the animation editor/properties bar.


Also, any graphic editors can allow you to make 8-bit sprites. Nice sprites come from the efforts and skill you put in them, whatever tool you use.
Common recommanded graphic editors are graphic gale, paint.net, gimp and photoshop.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Thu Jan 05, 2012 8:21 pm

Well, I know about the frames, but it's just not working, its going too fast.
B
4
G
1
Posts: 16
Reputation: 607

Post » Thu Jan 05, 2012 8:24 pm

The animation speed, from when you click the animation name in the animations bar.

It is is right in the article I've linked.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: emoticon, KeetonCat, makkancs, Matthew de and 25 guests