Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Sunflower

Pages: 1 ... 34 35 36 37 38
526
Journals / Re: What are you working on?
« on: July 27, 2011, 04:36:51 am »
I'm working on a text behavior, which allows you to draw text not exceeding given width, as well as format its colour and shape anywhere you want. As you can see in attachment, I even got it to working!

Well... almost. -. .-'

Also, "Lorem ipsum" takes 8 ms to render now, but after checking the code I found that without colour changing (but with font style) it takes only 3ms. >_< Which is not exactly that bad, because in font settings you can set your own colour. I'll probably need to get rid of this colour thing, then, as it can be done well without that.

527
Resolved Questions / Re: Questions for my first game
« on: July 26, 2011, 03:12:22 pm »
Not only that, but "if" block should be moved from "for each member" block. So it should be:
Code: [Select]
set Numver_Attribute to [0]
for each member of [Bricks]
  increment [Numver_Attribute] by [1]
if < [Numver_Attribute] = 0>      //no indent, because it's OUTSIDE "for each member" block
  //go to next level

And not:
Code: [Select]
set Numver_Attribute to [0]
for each member of [Bricks]
  increment [Numver_Attribute] by [1]
  if < [Numver_Attribute] = 0>      //in this code "if" block is in "for each member", which is WRONG!
    //go to next level

Also, don't forget to choose "Scene to Switch"! The best thing would be adding one more attribute, like, "Next_Level", which is Scene type. This way when you attach behavior to proper scene, you can choose which level is next (and you don't have to create different behaviors for different levels)!

528
Archives / index of [anything] in [list]
« on: July 26, 2011, 12:53:53 pm »
I'm quite surprised that there's block: "remove [anything] from [ list ]" which removes first occurrence of item in the list, and there isn't block which could just return an index of this item. It kinda doesn't make sense for me, as finding and removing item seems more complex thing to do than finding item itself. Am I wrong here? ^^'

So, could you add block "index of [anything] in [ list ]", which would return the position where the first occurrence is placed (or -1 if it wasn't found)? It's not that creating custom block with the same effect is extremely complex, but it would be nice to have this function already included. ;)

529
Ask a Question / Is there function to draw formatted text?
« on: July 26, 2011, 08:35:13 am »
As in question. I know that I can change colour of text or set whatever font I like.
I want to ask mainly about:
 - drawing text not exceeding given width (placing newlines before the word which is on the border; if you don't know, what I mean, write a post about it; after some words, when your text will be too wide for the box, you should see what I mean :P )
 - drawing text aligned to left/right/center
 - drawing text with e.g. different coloured word in the middle, something like:
This is red text and this one isn't.

It won't worry me much if such functions doesn't exist. I just want to ask because it may turn out that it's already included. If not, I can make a behavior for that. ^^

530
Resolved Questions / Re: Questions for my first game
« on: July 26, 2011, 07:37:37 am »
Uh, yes, I forgot one little thing. This wasn't supposed to be [Self], but [the actor] (to be found in the same place as "for each actor of the type []"). Sorry about that mistake. ^^'

---EDIT---

Oh, in fact, Greg's solution may be better for this. This "Number_attribute" thing is an attribute which you should define on your own, in "Attributes" tab (right next to "Palette"). Create a number-type attribute (e.g. "Number_attribute", as Greg named it), and then find proper functions in Palette, in "Attributes" tab (not the one for defining attributes, the one just below the "Scene" button).

531
Resolved Questions / Re: Questions for my first game
« on: July 26, 2011, 01:47:50 am »
All of this I make in design mode! If you don't know how to use it, I recommend you to learn it fast!

About title screen:
Make some button actors and do in design mode something like this in "always" block:
Code: [Select]
if <mouse [is down on] [Self]>     //"if" can be found in "Flow >> Conditional", "mouse is down on Self" in "User Input"
  [Fade out] for [1] secs, then switch to [Level 1] and [Fade in] for [1] secs     //to be found in "Scene >> Switching"
  set [Life] to [3]    //well, it IS necessary for 3rd question, it'll be explained later
Example above is for "New Game" button or whatever you call it. You can adjust it to others.

Progressing to a new level would require a boolean attribute "Level End" (hidden) and scene attribute "Next Level" (not hidden). After you add it (in "Attributes" pad, right next to "Palette"), you should include it in some scene behavior (check should be done after hitting the brick, I'll call it "blockCheck"):
Code: [Select]
when this hears [blockCheck]     //"Messaging >> Receiving"
  set Level End to <true>     //"Attributes >> Setters", after you've added "Level End" attribute in the same behavior!
          //"true" block can be found in "Flow >> Conditional"
  for each actor of type [Block]     //"Scene >> Actors"
    if <[Self] is alive>     //"Actors >> Properties"
      set Level End to <false>
  if <Level End>
    [Fade out] for [1] secs, then switch to [Next Level] and [Fade in] for [1] secs    //that's where you use "Next Level" attribute
    //you can choose next level when you add scene behavior to your level!
In bricks behavior there should be something like:
Code: [Select]
if {here put this all checking if block was hit by ball}     //
  kill [Self]
  tell this scene to [blockCheck] for behavior [Ending Level]    //or whatever you want your behavior to be called

About losing a life, I think it would also be good to put in scene behavior rather than any actor. So, make a "Life" global attribute (it's in Game Center, in "Game Settings >> Attributes"). It should be number. Remember this "set [Life] to [3]" thingy in title screen? That's to set your initial life! Of course, if you want it to be e.g. 5, all you need to do is to set initial value.
Now, for scene behavior:
Code: [Select]
when this hears [youFailed]     //I hope that now you know how to use this messaging thingy!
  set [Life] to [[Life] - 1]    //minus block can be found in "Numbers & Text >> Math"
  if <[Life] < [0]>     //comparison block: "Numbers & Text >> Compare"; you may want to use <= block instead
    [Fade out] for [1] secs, then switch to [Title Screen] for [1] secs
  otherwise     //"Flow >> Conditional", exactly as "if"
    //there should be some things connected with creating new balls etc.

Something unclear? O.o

532
Ask a Question / Re: Question about scenes
« on: July 25, 2011, 01:21:35 pm »
Well, what do you need it for, anyway? What kind of game? The more info I have, the better I can help you, because I have some possible solutions in my mind, but they are connected with different types of games. ^^'

Also, try using ~ button to keep your eye on actions time. Although normally you can't obtain more than 60 FPS, you should try adding "update" and "render" time. If I'm not wrong, those two times are completely defining time which your computer needs to perform ingame operations; other time is just sleeping necessary for game to not run too fast. So if render+update gives about 5ms, it means that even computer three times slower than yours should work with that quite fine (15ms is lower than 16ms).
I'm not sure about that, though. Maybe some person more experienced with Stencyl can correct me if I'm mistaken somewhere. ^^'

533
Ask a Question / Re: Snake Game Help
« on: July 25, 2011, 11:01:13 am »
Yay, I'll spam with the same topic link again! ^_^
[LINK]
I've improved a bit my Snake kit: now it contains Tiled Collision System. Also, I've already added fruits eating and dying on contact with tail. I'd recommend you reading my both posts in aforementioned topic. There are some important notes, I suppose. O.o

534
Shared Resources / Re: Snake Movement kit!
« on: July 25, 2011, 10:50:44 am »
I've added Tiled Collision System, which is based on map of characters rather than set of actors. If you don't know what I mean, [this screen] shows example of such map (so collision is based on comparing characters rather than positions, which is probably more efficient and precise enough for tile-based games).
If you want to add your actors using this system, don't forget attach it as behavior!

And no, it's not the only change here. I've also added dying on contact with tail and growing after eating fruit. Because of that you cannot find it as "Snake Movement" anymore! Now it's Snake Engine, since it's closer to complete game system rather than movement itself.

If you have any problems with my system, please contact me through forums. Any suggestions will be appreciated as well. ^^

(By the way, I'm thinking about making Tiled Collision Pack. Do you think it's a good idea? If so, what functions would you like to be added?)

535
Oh, so it means that I can make behavior with Custom Blocks only and just attach it to actors who use them, right?

Thanks, that helped me a lot! :)

536
So, I wanted to ask: what is exactly the difference between Custom and Global Custom blocks? I know that the first ones have Actor as first argument, and the latter can't work with Game Attributes, but is there something more?

I've noticed that both Custom and Global Custom blocks always appear in "Custom" tab, no matter if you're in the behavior which uses them or you're working on completely different one. So, does the Custom block have some limits of use, or it can be used in any behavior, and Global Custom blocks can be used in such way as well? Do I have to do something when I want to use Custom blocks in different behaviors? ^^'

537
Ask a Question / Re: Snake Game Help
« on: July 24, 2011, 12:16:44 pm »
Well, cole, nice idea. I really do like the concept of getting rid of collisions, as they're nothing but a bother. Oh, maybe they aren't, but now that you mention it, it's not necessary to have this collision thing (especially if everything we have is tile-based).

So, maybe try to make a map based on text? I mean, something like that (for 10x6 map):
Code: [Select]
..........
..SSSS....
..S..S..F.
.....S....
.....SSH..
..........
And then checking each part would be comparing two parts of this string. H stands for head, S for snake body and F for floor. Dot means empty field.
I hope you understand the concept. O.o

538
Ask a Question / Re: Snake Game Help
« on: July 24, 2011, 10:55:01 am »
Oh well, it seems that Stencyl doesn't want to make objects interact when they're set to "Cannot move" in physics. Geez, who cares about physics in simple snake game? -. -.'
Anyway, for now I'd recommend you setting physics parameters to move freely. Also, make collision boxes a little smaller; in tile movement you don't really need to have super-precise collision checking, and this way you'll avoid constant collisions.

539
Ask a Question / Re: Drawing an actor onto the screen..
« on: July 24, 2011, 05:12:25 am »
Well, first of all, the idea of creating actors over and over seems... kinda crazy. And when it's about health, which may change quite often, using normal actors instead of recycled seems even more crazy! O.o

Anyway, if you want to draw health, maybe it's better to do something like that:
In create:
Code: [Select]
repeat [4] //or however much health you want to have
    create [Health] at [40+[20*[current loop count]] ][5] at [Front]
    set actor value [MyValue] for [Last Created Actor] to [current loop count]
When health is changing, you can make "when this hears [HealthUpdate]" or whatever you want to call it. That's what you should put there:
Code: [Select]
for each actor of type [Health]
    if < [Health] < [get actor value [MyValue] for [the actor]] as number>
        Hide sprite for [the actor]
    otherwise
        Show sprite for [the actor]

As for object not spawning... I have not idea what may be the reason. Are you sure they are not spawning (except e.g. spawning, but as invisible?). Have you made some print checks? Also, maybe you shouldn't put it in "when drawing" block, anyway? O.o
Could you please make "Always print" behavior for Health actor which has one single thing: print "whatever" in "always" block? Then check if anything is printed by pressing ~. Maybe this will work? (of course, as soon as you don't need these checks, get rid of this whole printing; it slows down the game ^^')
I mean, assuming that this problem still occurs, even after using my system (or whichever you want, but please, without spawning actors every frame! -. .-')

--- EDIT EDIT EDIT!!!11!!1!1 ---
Agh, so you edited it, after all? ^^'
Anyway, just create it wherever you want (assuming that x,y of screen at that time is 0, otherwise I'm not sure what will happen O.o), and then anchor this actor to screen. For example, when it's created, place there: anchor [Self] to screen. It should work, I suppose.

540
Ask a Question / Re: Snake Game Help
« on: July 24, 2011, 03:50:05 am »
Working on Snake Movement kit right now, I'll let you know once I finish it! :)

---EDIT---
Here you go! [LINK]
Unfortunately, I haven't managed to do dying on collision with body system (apparently I'm not really experienced with collisions in Stencyl, after all O.o), but movement works nicely. With 240 parts on screen (which is 12x20, screen size in tiles I used) it didn't exceed 5-6ms render+update time on my machine, so on your it shouldn't be a great problem, either. ;)

Pages: 1 ... 34 35 36 37 38