PixelRebirth's Recent Forum Activity

  • Well I didn't use the turret behavior so far, but it looks like if you put Sprite (the enemy)and RockFeet in a container it does work. Btw I don't think it always destroys the first, but resets the base object when you kill one.

    Of course when you kill an enemy rockfeet will be destroyed as well. But you could always spawn another sprite for some kind of debris.

  • I originally started this because of some Pac-Man related threads on the Help/Tech forum.

    Basically it's a level editor/pac-manish engine. You can save and load. It supports custom tilesets (Create a new folder in the gfx\ subfolder. Put your 32x32 PNGs there. See the standard tileset to learn how to name the images properly).

    Click on RUN IT! and you can play your level. Well, kind of. There's still a lot missing to be a complete Pac-Man game. Like enemy interaction, stuff to collect or score. Graphics are very basic and just placeholders for the most part. But you can move and the ghosts will move around randomly.

    I still have much on the todo-list, but I'm not sure if I will continue with this anyway. For me it was mainly an exercise in using Construct. I may change it into something different, not Pac-Man related. Or I may polish it up a little and release the source.

    We will see, here is PUOP 0.2b for now.

    (One level is included. Type "fav2" in the textfield below and click on LOAD)

  • Okay, probably you may want to wait for some brainiac to explain it to you properly. And as I'm writing this I'm noticing mighty Ashley replying... I'll still reply anyway.

    I'd say you need loops where you want certain events/actions being executed many times a tick, instead of only once.

    I have uploaded a little example for you with a WHILE loop. We have a Global there called Outcome and we want it to have the value 0,1,2 or 3, which is Random(4) of course. But we also want to be able to dynamically exclude certain possibities. We define these with the Nono_a and Nono_b globals. The values set there are values Outcome must never have. So we cannot simply run Random(4), but we run it until the result will be different from Global Nono_a+b. And all this will happen in the same tick, thanks to the while loop.

    So if you run the example hit X and you will see the value will always be different from the ones defined in the Nono globals.

    I hope that was some help at all... maybe this example was horribly lame.

  • Why wouldn't it work? Do you have the same animation names and number of frames in both sprites?

    Look at this cap, press 1, 2 or 3 to change animations... as you can see it works just fine.

  • I don't think the grid behavior works too well for a Pac-Man game, since the sprite would only be able to move from grid space to grid space. That would be especially annoying if you were using it for the player sprite itself.

    I'm pretty sure there are many other ways to do the same thing, it's just the one that came to my mind. If somebody had a very simple solution I'd like to see that too.

    Anyway, I found one bug in my latest example. Has to do with the starting position of ghosts which can create infinite loops right on startup (my first example didn't have that bug). I've fixed this and added the ability for ghosts to handle a dead end (to turn around, this would have caused a infinite loop in both older examples).

    Also I've turned it into something a little different. Right now you can only draw your level, place ghosts and then run it to see what happens. I know it's far from a complete Pac-Man game yet. But I believe this could be really cool with features like being able to load different tile/sprite sets and save/load created levels of course. I'm currently thinking about turning this into a little side project of mine.

    No source for this sry, but maybe it's still interesting: DOWNLOAD

    [quote:22wev2cc]I m going to decrypt this code line by line until i understand the way you came to this.

    That's a very good attitude right there. Once you get the hang of it you'll come up with your own (better?) solution.

  • No I don't think it's a bug.

    Just put the Sprite in the event sheet where you have the family green now and it should work.

    The hashtable is in a container with the sprite, so it won't work the way you want it to when you're using the family this way.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Okay I put some comments in there and I was able to optimize it a little at least. Uses 4 events less now. Here it is.

    If you're fairly new to Construct you still may have problems to immediately understand what's going on in there. Just give it a little time, toy around with it maybe...

    Any more questions feel free to ask.

  • There's nothing wrong with that expression. It will just give you one of four different directions.

    But the way you're using it won't work for what you intend to do. Since the direction you get can very well be the very same direction you just had and therefore the ghost will move into the walls. (I don't think you need the "floor" in there btw)

    I'm basically using a loop in my example that checks all four sides of the ghost and will only allow directions which aren't blocked by any walls.

    Okay I will comment my cap. Just give me a little time.

  • Can't say I don't like it. But it looks a little blurry compared to the "pixelartish" style.

  • I have cooked up a quick example of basic ghost movement. May be not the most clever way to do it, but it works.

    I didn't really care to comment it, after all it's just 28 events. But if you need further explainations don't hestitate to ask.

  • You wouldn't happen to have a nvidia graphics card by any chance? Well anyway, I figured it out. It should work for everyone now.

    Try this.

  • This looks like a very cool concept Quazi!

PixelRebirth's avatar

PixelRebirth

Member since 26 Mar, 2008

Twitter
PixelRebirth has 1 followers

Trophy Case

  • 16-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

23/44
How to earn trophies