SHUFFLE PUCK "3D"
- tperry2x
- Posts: 1538
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
SHUFFLE PUCK "3D"
game-ideas-01 video
I can always find some ideas of things we can adapt or xtalk-ify. (Even if I lack the maths skills to do them myself).
[EDIT by -- xAction] --- changed name of this thread to match our game development action.
I can always find some ideas of things we can adapt or xtalk-ify. (Even if I lack the maths skills to do them myself).
[EDIT by -- xAction] --- changed name of this thread to match our game development action.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Game ideas 1
Just get the basics in place, and then fudge the math later, fake it til you can make it.
Take that "3D" shufflepuck game for instance, that's not even 3D. it's just 2D pong, but the sprite gets shrunk as the Y location changes. Everything is just -1 or 1 (or 2 or -2, something like that) You get prototype together and then you say "Hey internet/chatGPT/Bing Copilot how do I make X do Y?" and you get 10 wrong answers and get frustrated and solve it on your own.
Or have a nap and wake up and try something new and then ten years later you pick up the project and all of a sudden you know how to do it, right up until you hit some other roadblock.
Take that "3D" shufflepuck game for instance, that's not even 3D. it's just 2D pong, but the sprite gets shrunk as the Y location changes. Everything is just -1 or 1 (or 2 or -2, something like that) You get prototype together and then you say "Hey internet/chatGPT/Bing Copilot how do I make X do Y?" and you get 10 wrong answers and get frustrated and solve it on your own.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Or have a nap and wake up and try something new and then ten years later you pick up the project and all of a sudden you know how to do it, right up until you hit some other roadblock.
- tperry2x
- Posts: 1538
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: Game ideas 1
Love this. Excellent work.
I think I'll experiment in making this a more graphical version, so just to let you know - in case you have more work you are doing on it.
Without ripping off Shufflepuck Cafe, I'll create my own character to play against and have a dabble.
Before I do though, just made some little changes: Changed the angle of the walls. I changed the behaviour slightly, so that the game continues if the mouse leaves the confines of the stack. The Puck cannot travel beyond the left/right confines of the stack window. To start the game, you click the "Start Game" button. (This will change and probably be a menu in the final one). Also, you stop the game by choosing the "Pointer" tool, but I'll have this stop when the escape key is pressed too.
One thing I'd like to add is the ability to also move the "Paddle" of the player up and down the play area slightly. To give extra inertia (more oomph) to the return / serving speed of the puck.
I think I'll experiment in making this a more graphical version, so just to let you know - in case you have more work you are doing on it.
Without ripping off Shufflepuck Cafe, I'll create my own character to play against and have a dabble.
Before I do though, just made some little changes: Changed the angle of the walls. I changed the behaviour slightly, so that the game continues if the mouse leaves the confines of the stack. The Puck cannot travel beyond the left/right confines of the stack window. To start the game, you click the "Start Game" button. (This will change and probably be a menu in the final one). Also, you stop the game by choosing the "Pointer" tool, but I'll have this stop when the escape key is pressed too.
One thing I'd like to add is the ability to also move the "Paddle" of the player up and down the play area slightly. To give extra inertia (more oomph) to the return / serving speed of the puck.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Game ideas 1
Excellent! I'm working on a Game Template Stack so we don't have to reinvent the wheel for every example.
That's shufflepuckery is some dumb fun.
Since mousedown isn't used in the game (unless you make it a shooter! pew pew) you can just have a mouseDown in the card or stack script to start a game.
Since the final window size is variable you'll need some math to get to the corners of the screen.
I was over due for sleep making that first demo so I just slapped in whatever numbers seemed appropriate.
Here's the calculation of SLOPE you need for that
and Right wall subtracts from X (width of the card= whatever) every step of the slope
Keep the function handy, it'll be the same function used when you want to shoot at something that isn't in cardinal directions. The bullet will re-use the slope to arrive at the location targeted when it was released.
I had this function in my bag of tricks but forgot about it, and so asked BING, and ...the eye searing mathematical expressions it used to explain things made my blood pressure shoot through the roof.
Nvidia CEO:"Kids don't need to learn to code. The AI will do the coding."
Microsoft CEO:" Everyone passed calculus II, right? Right?"
That's shufflepuckery is some dumb fun.
Since mousedown isn't used in the game (unless you make it a shooter! pew pew) you can just have a mouseDown in the card or stack script to start a game.
Since the final window size is variable you'll need some math to get to the corners of the screen.
I was over due for sleep making that first demo so I just slapped in whatever numbers seemed appropriate.
Here's the calculation of SLOPE you need for that
And here's a stack to demonstrate how it is used. Left wall adds to X (left of the card =0 ) every step of the slopefunction Math.calculate_slope x1, y1, x2, y2
put (y2 - y1) / (x2 - x1) into slope
return slope
end Math.calculate_slope
and Right wall subtracts from X (width of the card= whatever) every step of the slope
Keep the function handy, it'll be the same function used when you want to shoot at something that isn't in cardinal directions. The bullet will re-use the slope to arrive at the location targeted when it was released.
I had this function in my bag of tricks but forgot about it, and so asked BING, and ...the eye searing mathematical expressions it used to explain things made my blood pressure shoot through the roof.
Nvidia CEO:"Kids don't need to learn to code. The AI will do the coding."
Microsoft CEO:" Everyone passed calculus II, right? Right?"
- tperry2x
- Posts: 1538
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: Game ideas 1
I have to admit, I cheated.
I just resized the graphics, which replots the points.
(I didn't pass 'calculus')
Version 3 has a bit of force added, and you can now hit it past the ends of the table (at which point the game stops).
I've tried to comment throughout, so it makes sense (at least to me, but hopefully everyone else too)
I just resized the graphics, which replots the points.
(I didn't pass 'calculus')
![Laughing :lol:](./images/smilies/icon_lol.gif)
Version 3 has a bit of force added, and you can now hit it past the ends of the table (at which point the game stops).
I've tried to comment throughout, so it makes sense (at least to me, but hopefully everyone else too)
-
- Posts: 281
- Joined: Sat Sep 11, 2021 4:37 pm
- Contact:
Re: Game ideas 1
Is the Server engine part of the OXT mix? Might be nice to demonstrate relay servers with a turn-based game.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: Game ideas 1
I updated it where there is no longer a random direction for just hitting the paddle
the lastPaddleX is stored every 10 game loops
if item 1 of the mouseLoc is less than the stored position, then puckDirX = -1 else puckDirX = 1
10 loops gives you enough time to move just before the puck hits, that could maybe be fine tuned
Also when the puck is initialized it gets a random direction
Also I adjusted it so that when the puck collides with the paddle, screen is locked and the puck is placed 1 pixel above the paddle so that it can't get stuck and jitter inside of the paddle.
Was just thinking of network stuff a minute before returning to the forums and reading that.FourthWorld wrote: ↑Tue Mar 05, 2024 4:01 pm Is the Server engine part of the OXT mix? Might be nice to demonstrate relay servers with a turn-based game.
Remember the old revChat? i got so little done because of it, but learned a bunch from being there.
- tperry2x
- Posts: 1538
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: SHUFFLE PUCK "3D"
I like it, and I've used some of your suggested code. I have tweaked it a little though:
This is so that if you hit the puck with the left or right edge of the paddle, it'll bounce in the direction you'd expect
Code: Select all
-- puck "hit by player"
if the bottom of graphic "puck" > the bottom of graphic "paddle" then set the bottom of graphic "PUCK" to the top of graphic "Paddle"-1 -- stops it getting stuck
-- instead of using "randomVector() into puckDirX" -- random left / right bounce direction
-- I'm using this instead:
-- bat the puck to the left
if the left of graphic "puck" +20 < item 1 of the loc of graphic "paddle" then put -1 into puckDirX
-- bat the puck to the right
if the right of graphic "puck" -20 > item 1 of the loc of graphic "paddle" then put 1 into puckDirX
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: SHUFFLE PUCK "3D"
Hell ya, that's working out great!
You can set the markerDrawn of those lines to false now that we know collision detection is working well.
You can set the markerDrawn of those lines to false now that we know collision detection is working well.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: SHUFFLE PUCK "3D"
Can't help myself, Must make changes!
outerGlow["size"] & outerGlow["spread"] & innerGlow["size"] & innerGlow["spread"]
Applied to almost everything , with subtle changes made when the puck collides
Every Game.Loop UI.ResetGlowSpread is sent
a new global...GlowCounter increments by 1 and says "Nope, gonna glow" until it hits 20
Er...now that I think about it, it's always counting to 20 so the de-glow is not actually evenly timed, derp.
Well it looks good for the moment.
I shrunk the player paddle height a little.
Oh also added object "PuckReflection" it's offset a tiny bit from the puck and blended in.
I tried the same on the player but did not like the effect there.
Oh here's some scripts you might care to use.
add a global bShowMouseCursor
add this and include in init.App
it makes a tiny 1 pixel image to use as a cursor ID ,ie, invisible cursor
outerGlow["size"] & outerGlow["spread"] & innerGlow["size"] & innerGlow["spread"]
Applied to almost everything , with subtle changes made when the puck collides
Every Game.Loop UI.ResetGlowSpread is sent
a new global...GlowCounter increments by 1 and says "Nope, gonna glow" until it hits 20
Er...now that I think about it, it's always counting to 20 so the de-glow is not actually evenly timed, derp.
Well it looks good for the moment.
I shrunk the player paddle height a little.
Oh also added object "PuckReflection" it's offset a tiny bit from the puck and blended in.
I tried the same on the player but did not like the effect there.
Oh here's some scripts you might care to use.
add a global bShowMouseCursor
add this and include in init.App
it makes a tiny 1 pixel image to use as a cursor ID ,ie, invisible cursor
Then Toggle.MouseCursor when game starts and toggle it back when it resetson init.InvisibleMouseCursor
put 0,0,1,1 into TinyRectangle
set the rect of the templateImage to TinyRectangle
set the showBorder of the templateImage to false
set the name of the templateImage to "InvisibleCursor"
if there is an image "InvisibleCursor" then delete image "InvisibleCursor"
create image
export snapshot from rect (rect of image "InvisibleCursor") to image "InvisibleCursor" as PNG
end init.InvisibleMouseCursor
Oh it probably makes sense to have these tooon Toggle.MouseCursor tBool
put not bShowMouseCursor into bShowMouseCursor
if tBool is not empty then put tBool into bShowMouseCursor
if bShowMouseCursor is true then
reset cursors
set the defaultcursor to arrow
set the cursor to arrow
else
set the defaultcursor to the ID of image "InvisibleCursor"
end if
end Toggle.MouseCursor
--- if something is turned on/off or true/false use a Toggle. prefix to identify it
on Toggle.Playing tBool
if tBool is not empty then
put tBool into bPlaying
else
put not bPlaying into bPlaying
end if
Toggle.MouseCursor (not bPlaying)
end Toggle.Playing
--- if we left the window then pause, maybe something awful is happening with script
--- if we return to window, play the game
on mouseEnter
if bPlaying is false then
choose browse tool
Toggle.Playing
Game.Continue
end if
end mouseEnter
- tperry2x
- Posts: 1538
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Britain (Previously known as Great Britain)
- Contact:
Re: SHUFFLE PUCK "3D"
I like your version too.
I've decided to leave mine at this point, as it illustrates the concepts to anyone and goes as far as I need to go with it.
Feel free to carry on with your version as I like the Tron-esque appearance.
I've decided to leave mine at this point, as it illustrates the concepts to anyone and goes as far as I need to go with it.
Feel free to carry on with your version as I like the Tron-esque appearance.
-
- Posts: 285
- Joined: Thu Sep 16, 2021 1:40 pm
- Contact:
Re: SHUFFLE PUCK "3D"
Great!. Looks so professional. And right, it's good to hit a stopping point for someone to come along and learn from it. Start adding menu screens and options and it's a lot more code to break by accident.
- OpenXTalkPaul
- Posts: 1574
- Joined: Sat Sep 11, 2021 4:19 pm
- Contact:
Re: SHUFFLE PUCK "3D"
Wow awesome, I loved me some Shufflepuck back in the day.
Just needs some funny looking Aliens characters to play against.
Just needs some funny looking Aliens characters to play against.
Who is online
Users browsing this forum: No registered users and 20 guests