Event Sheet Issues

For questions about using Classic.

Post » Tue Nov 30, 2010 8:33 pm

I'm new to Scirra and Construct, I came at the direction of a friend who saw my mild frustration with GameMaker. I'm a pixel artist first and foremost, and while I am taking Computer Science classes, I have yet to be anything but passingly familiar with programming languages, and yet it's really difficult to find programmers willing to work through a project to completion.

I apologize if I missed something somewhere, or if this is obvious. I read through various tutorials and parts of the FAQ, and found nothing on this.

Whenever I right-click in the Event Sheet and select Insert Event, it takes me to the screen for creating a Condition and not an Action.
B
2
G
2
Posts: 12
Reputation: 674

Post » Tue Nov 30, 2010 8:55 pm

Welcome,
Actions can be added after the event is created by left clicking [color=#FF0000:3sa61ubk][u:3sa61ubk]+ New Action[/u:3sa61ubk][/color:3sa61ubk] at the right of the event.
B
79
S
24
G
54
Posts: 4,747
Reputation: 40,757

Post » Tue Nov 30, 2010 9:06 pm

The problem is the Event itself; the System should create a new sprite when x occurs, but I can't set that, because I get a list of Conditions instead of Actions. The Creation events are in the Actions list.

What irks me is that previously I've made System Actions simply by clicking Insert Event and having it take me straight to the Actions screen, where Creation is available as an option.
B
2
G
2
Posts: 12
Reputation: 674

Post » Wed Dec 01, 2010 12:32 am

"the System should create a new sprite when x occurs"

The condition is when "X" occurs, and "X" needs to be checked first, before you create the new sprite. So you need a condition first.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Wed Dec 01, 2010 1:29 am

X occurs -> action

It's not like a programming language where you can just say "new object;" without any conditionals.

You must first add a condition like "always" if you want the statement to be executed every frame. Another way to make a statement that runs every frame is to just put a blank condition box and add an action to it. For example, add an "always" condition, then select "always" (the condition, not the whole event) then press delete.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Wed Dec 01, 2010 11:01 am

Ah! So I was being an idiot all along. Thanks a ton, guys.

Since I've only just begun my first game (based on the unfinished Vertical Shooter tutorial on these forums), I may have more questions later on. Stay tuned and watch me flounder, as it were.

EDIT: Speak of the devil.

I just finished up implementing the "enemy ships," but at runtime they come out warped on the game screen, and I haven't the slightest idea why. Since I have no way of showing you what's wrong, I uploaded what exists of the game so far (it's nothing serious, just a test to get used to Construct before I try to handle something larger and/or more ambitious).

http://www.mediafire.com/?aydx4rmzcs2s24z
B
2
G
2
Posts: 12
Reputation: 674

Post » Wed Dec 01, 2010 4:27 pm

Select the enemy sprite object and go into the properties on the left side of the screen and click "Size - Make 1:1"
B
2
G
3
Posts: 16
Reputation: 882

Post » Wed Dec 01, 2010 11:31 pm

Thanks a ton! Sorry if I'm making myself look stupid, I realize my issues are fairly plebeian in nature. :/

So, here's a question: if I have say three or four different sprites that I want the computer to randomly generate at the top of the screen (randomly both in terms of the x axis and in terms of the sprites themselves), how would I work that in? I'm sure there are multiple ways.
B
2
G
2
Posts: 12
Reputation: 674

Post » Sat Dec 04, 2010 8:22 pm

I personally would just assign a variable a random number for the sprite number and the x coordinate.
:::Note that this is pseudo code:::
Basically tempx = random(0 - window width) that can be called using create object at tempx and using the y coordinates that you wish to use.

Generate a different variable for the sprite number, like spriteframe. Now you would want to create a random number from the total number of sprites available (I am assuming that this is the same object with different sprite frames) and add 1 to the total.

spriteframe = (random(3)+1)

See example here:
[url:3lm0t7q7]http://www.mediafire.com/?cjcel43k8jwfnj4[/url:3lm0t7q7]
B
1
G
2
Posts: 3
Reputation: 631

Post » Sun Dec 05, 2010 1:24 am

That was really helpful, thanks. We'll see how it goes once I get around to implementing it.

I'll have to make each of these objects as spriteframes, though, currently they're all separate objects. It makes sense for them to be frames, though, I suppose. If I need them later as individual objects, I don't see why I can't just call that particular spriteframe and set the animation rate to 0.
B
2
G
2
Posts: 12
Reputation: 674

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 1 guest