FACER Community

[Watch Face] Air Hockey

Just for some fun:

9 Likes

Brilliant. Been watching for a Goal for a while. :joy::slightly_smiling_face:

4 Likes

Nice one! I’m glad you didn’t do it at the full speed of those air hockey puks. :laughing:

3 Likes

Nicely done Brad, and I love how you’ve done the Font for the Time :+1:

2 Likes

Thanks @icrltd4, it’s graphic images, one image for each digit, with opacity set to turn on when appropriate. Not a ttf font.

2 Likes

i’m always fascinated of your works , if i can ,i have a couple of ask , first, do you think it will works with a wristmove control of palette? if yes i would like your help, if it is possibble obviously ,on a my private draft ( a pong one )that need to fix better the ball move , it wil stay private not for pubblish , just a personal challenge

the stop palette is wrist controlled , its a fake illusion of game the ball still in game always but it has a sort of arc move that dunno how to fix

3 Likes

Hi @alsx65,

I haven’t created a version that works with the wrist motion. Of course that would be easy to control the paddle by tying in the Y coordinate with the gyro or accellerometer, but to add the logic to let the ball pass if you miss, or bounce it back if you hit it, is a bit of a challenge within the Creator webapp, that I’m not sure about. I considered this, but for that challenging reason I simply made it easy and had the paddles match the Y axis location.

Your Fong work in progress is really great! Yes, I had that bouncy effect originally when I was creating one of my pong faces, but then I tried a different approach to the expression, away from sin/cos/tan (which causes the bounce effect) and made it linear and got it to work. For this example, I opened up inspection for you. The coordinate of the puck is:
X: ((((abs(((#Dsm#+2)-(3*(floor((#Dsm#+2)/3))))-1.5))/1.5)*160)+80)
Y: ((((abs(((#Dsm#+2)-(2.2*(floor((#Dsm#+2)/2.2))))-1.1))/1.1)*110)+100)
In your Fong example you are using sin/tan functions, non linear, so you get some bounciness and curves/arcs.
Also open for inspection is this one from a while back in our stock only challenge.

I think you might be able to use that expression for the ball too. In that example, the ball expressions are:
X: ((((abs(((#Dsm#+2)-(10*(floor((#Dsm#+2)/10))))-5))/5)*100)+33)
Y: ((((abs(((#Dsm#+2)-(6*(floor((#Dsm#+2)/6))))-3))/3)*150)+83)

Breaking down the expressions for you:
((((abs(((#Dsm#+2)-(A*(floor((#Dsm#+2)/A))))-(A/2)))/(A/2))*B)+C)
A=speed variable. The smaller the faster, the larger the slower. Probably a range of 0.5 to 10 is ok, depending upon your preference.
B=window width
C=window offset

Of course, don’t keep your Fong private, publish it away when you got it! :+1::grin::+1:

3 Likes

Wow , that’s a big tutorial reply, many many thx for all those clear explain and the opened inspection , i looked into the creator only version alot of time but i understand only now after your explain,you are giving at this comunity alot of gifts with your works , cant wait to start fixing fong,many many thx again for your support

3 Likes

Yeah Topic Bookmarked.

3 Likes

updated , yuppppp now it works fine , thankyou

3 Likes

Graet Stuff.

2 Likes

Great! Glad it is working for you! Please publish Fong once you are ready, the community will love it! :+1::+1::+1:

3 Likes

Pubblished :+1: many thx

3 Likes

Looks great @alsx65, I tried it on my original galaxy watch. The gyro effect is nice. I would subtract about 25-30 pixels to the paddle’s Y axis gyro/accelerometer effect as it centres a bit low below the bottom of the box and not high enough at the top of the box. Also, maybe multiply it by (-1) since my instinct in tilting my wrist is the complete oposite of the direction it goes. But maybe that is a personal preference. Nice though!! :+1::+1:

Hmm, maybe should I add the gyro to one of the air hockey paddles for fun…???

3 Likes

I think you must not should do an interactive version of air hockey ,both paddle wrist controlled :muscle::grin:

2 Likes

Ha! Ok sure, I updated it, but only for player 1, the blue controller. But one thought that came up as I did it, you should add limits to your accelerometer control, something like this:
$(170+((accelerometerRawY())*(-12)))<103?103:$$(170+((accelerometerRawY())*(-12)))>208?208:(170+((accelerometerRawY())*(-12)))$
Where the 103 and 208 are the limits of the window where you want the controller paddle to move around in. This is just the window I used in Air Hockey at least. It stops the paddle from going outside the box for users with lots of wrist action - hmm, not sure if that is comming out well :roll_eyes:.

I was looking if there is a function like $accelerometer==true?(user control):(AI control)$. Can’t seem to find one. I’d like to turn on gyro control for the paddle if there is an accelerometer sensor on the watch, and use AI control if there isn’t. It will show up better in the web preview if such a function exists. Anyone know of one?

3 Likes

Tested now your hockey , down paddle stops fine but up it desappear , i forgot to use a formula by RUSTY CRESS that he make for my asteroid and i used for my Dino lately to limitate the position, i’ll fix tomorrow .

3 Likes

@bradtc This works I used an Image for he Paddle so I could make the middle the centre .

(clamp((140+(accelerometerRawY())*(16)),80,240))

3 Likes

Thank you @russellcresser, that hits the spot, and the puck stays on the ice. Combining your expression with an if/then statement, I can now have the watch test if the accelerometer is active, if not, then use the Y axis coordinate of the puck on the paddle to similate AI control. If the accelerometer is active, then use the accelerometer to control the player 1 (blue) paddle. Works much nicer in the web preview and in watches without an accelerometer. :+1::+1::+1:

$(accelerometerRawY())==0?((((abs(((#Dsm#+2)-(2.2*(floor((#Dsm#+2)/2.2))))-1.1))/1.1)*110)+100):(clamp((160+(accelerometerRawY())*(-12)),106,208))$

Now I’ve got to figure out if I can get it to make a goal every once in a while. Maybe if you manually hit the puck well enough, you can score on the red goal??? Hmm…

3 Likes

We have If’s to help us sad we do not have Buts . I know when the ZX81 came out there were guys making games on One Line . We have lots of limits . I think it is nice just to be able to hit the Puck . I think you would need to go pro so you could se t Flags . Any way all good fun .

3 Likes