Jezzball-like interface

andrewm2211andrewm2211 Member Posts: 341
edited June 2012 in Working with GS (Mac)
Hi all,

I'm working on a game that has similar gameplay to jezzball, see the link for those who don't remember

http://onemorelevel.com/game/jezzball

Now my game will work a little differently, instead of clearing off chunks of the map, I want to make it so if they are trapped in a box lets say with the surface area of 50px, then the ball explodes, or dies, or you get points or whatever.

right now I have a guy running around that shoots(spawns) rays perpendicular to him and i have it set up so they get destroyed and then spawn a barrier. (side question, is this too much spawning and destroying should I recycle?)

And I can successfully trap a ball, but I don't know how to acknowledge the square it's in is small enough to destroy the ball/give points.

I thought of having the 'barrier' actor spawn another actor at a certain size, and when 4 of them touch the ball, then have the ball destroyed. So... 'if barrier spawn collides with actor>ball> change attrib> touch +1'

But I did tests and it seems if there are more than one instances of the same actor touch the ball it doesn't keep adding.

Okay I hope that was coherent, thank you all in advance!

Best Answer

  • tatiangtatiang Posts: 11,949
    edited June 2012 Accepted Answer
    I had an idea... what about making a few "bullets" discover the barriers' locations? You would spawn the range finder actor from a ball, most likely.

    See the attached demo.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I love those types of games. How about if you kept track of how far the ball was moving vertically between barriers by subtracting its Y values upon collision -- and how far horizontally -- and then calculated the area of the rectangle bounding the ball?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • andrewm2211andrewm2211 Member Posts: 341
    Hi tatiang, thanks for responding.

    that's a possible solution, I'm just afraid it might bounce around vertically for like 45 seconds before bouncing horizontally, and the user will be sitting there like
    "hey I won already hurry up!"
    Seems like there is a little room for weird stuff to happen that way.

    That being said, it's better than any solution I've yet to come up with!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited June 2012
    that's a possible solution, I'm just afraid it might bounce around vertically for like 45 seconds before bouncing horizontally,
    Hmm, good point. I'm trying to make a demo, so if I come up with a better idea, I'll let you know.

    Edit: so I think you might be able to do it by looking at the x value of the ball and figuring out which barriers are closest to it (you'd have to add barrier x values to a writeable table as they are added to the scene) and then figuring out the distance between them.

    Not sure if I have time to do all of that, but perhaps it can lead you in the right direction!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • andrewm2211andrewm2211 Member Posts: 341
    okay I think you got me on to something that will work, thanks!

    any opinions on the amount of spawns/destroys I'm using?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    any opinions on the amount of spawns/destroys I'm using?
    I'm not sure there's a good alternative. I guess you could have a bank of barriers off-screen and then recycle them, but that seems pretty messy.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • andrewm2211andrewm2211 Member Posts: 341
    that's a great idea! thanks for taking the trouble to do that!

    I'm doing something a little different now, which might work better in my game(might), just because of the way it's setup.

    basically I have 4 actors, sticking out of the ball all 20px long, one each direction. When they collide with a barrier, it triggers a boolean. When all 4 booleans are checked, then the magic happens.

    Thanks! I would not have came up with this if it wasn't for our brainstorming session we had here!
  • andrewm2211andrewm2211 Member Posts: 341
    this project is pretty interesting , def learned something!
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Yeah, I like that idea, too... kind of like bumpers for the ball. Nice, glad you found something that could work!

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.