Platform Games with xTalk

A forum to share your demonstrations stacks, fun stacks, games, etc.
Post Reply
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Platform Games with xTalk

Post by xAction »

Platformer_0001.oxtStack
(18.18 KiB) Downloaded 19 times
Platformer.gif
Platformer.gif (115.49 KiB) Viewed 192 times
This is a super simple small "Get On Up" platformer where you have to reach the top of the screen to score.
The controls aren't super great, but it can be fun and challenging despite the imperfection.
Was going to make a Pitfall clone but needed something to jump on to test the jumping /moving and well...once I had something to jump on then I need it to move, and here we are.

Again if you do any developer work: switch to pointer tool and back to browse tool before playing the game or the timing will be crazy on account of the 'send in x milliseconds' loops tuning into an avalanche of messages.

Hmm just noticed if you rapid fire click the screen to restart the game it speeds things up faster and faster. That's probably a bug but I don't want to bog down the script with any more complexity at this point.
User avatar
tperry2x
Posts: 1533
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Platform Games with xTalk

Post by tperry2x »

These are all great examples of what is possible, and would be a good idea to download them all.

Would you have any objection to me including all these in an xtalk examples stack, visible via the help menu?

I'll gladly credit you as the author.
If that's okay, could I also please use your descriptions in your various posts, as readme info inside the examples stack?

I also have a suggestion (more to see if it's possible within xTalk)
Can you make something such as this in OXT?
https://wim.vree.org/gpjs/

It doesn't have to be as complex as this, or model all the in-game behaviours. I simply wondered how gravity of falling objects would work, so if a character graphic that the user controlled, pushed a boulder off the edge of a platform - how to make it fall until it "lands" on a platform (or any platform).

Then, to add to the complexity - if you had the player in a tunnel. All around them is earth, with boulders contained within. If the player tunnels underneath a loose boulder, how to make it fall and potentially squash the player - after an initial delay (where perhaps the boulder shakes), allowing the player a chance to move out the way?

There's a lot of "Ifs" there, so feel free to say no to any of that.
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Platform Games with xTalk

Post by xAction »

No objections at all, no credit for me needed just credit "xTalk Community," make us look HUGE.
These examples are long overdue, I wish I could have wrapped my head around them ages ago.
Use the text in forum posts for 'documentation' where applicable.

As for that "Puzzle-Platformer" demo , sure we can do that, probably pretty easy.
Thanks for the suggestion, actually.

There is an example of gravity and the 'push' behavior in this platformer demo in fact.
Let's see if I can psuedo code it...

if Player collision occurs with 'boulder', then the player's x or y direction value (-1, or 1) is transferred to the object, creating the illusion of a push.

All objects that can move receive an update every game loop, even if their move values are 0, once that value changes they will move.

Each loop of the game all movable objects will have their collision checked, this is done by checking the topLeft, topRight, bottomLeft and bottomRight being within the rect of another graphic. Intersect might be more applicable with sprites that have feet and pushing hand pixels? Haven't tried that yet.

If the falling type object is not colliding with some object then it's Y direction value is set to 1, so each loop it will 'fall' one pixel, just like the player moves in whatever direction their value is not 0.

To do the delayed drop thing, you have some value in the object like AvalancheDelay, after the first lack of collision at the bottom of the object is detected, or a collision with the player at the bottom of the 'boulder' is detected, that starts to count up (or down) one measure each game loop, when it hits whatever limit is desired then the Y value is set to one and it will fall 1 pixel each loop until it hits something. Might also have a bDangerous or bAvalanche value in the object to set it as deadly instead of just something he can push around with his head, or something that kills him the first time he runs under it.

Animating the boulder getting loose, if you had some sprites for that then those could be the trigger that makes it fall, ie, when it's done displaying it's "get loose" frames, then plummet. In a graphics only example we could use points like in the circle demonstration to animate some changes to the 'boulder' or even just tweak it's rotation a little bit to give it the shake before fall effect.

I'll work something up, using only built in graphics to keep things simple and Major Havoc'y.

I feel we need some kind of asset manager for sprites, because you import a bunch of stuff then make it all vanish off screen until you need it, which produces a mystery of "How'd that get there?" for the next person that comes along, at least with vector graphics it's all right there in the code.
I'd like to write a file parser for some of the popular tilemap editors so i don't have to write the tilemap editor myself, yet.
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Platform Games with xTalk

Post by xAction »

Puzzle_Platformer__001.oxtStack
(551.86 KiB) Downloaded 18 times
PuzzlePlatformerl_001.gif
PuzzlePlatformerl_001.gif (83.19 KiB) Viewed 163 times
Not entirely pleased with this, Had working like 99% and then...I did something and ...it's not 99%, maybe 85% now.
I think it's the number of objects I'm checking collision on.
Too tired to think at the moment, but there ya go, movable rocks that get disturbed, get dangerous, and crush the player.

Oh so I made a little animated guy out of polygon graphic which worked out great, until I flipped the points, then things got weird in there. Maybe have to hand draw both sides of the animation....or I was thinking, what if we translate BVH animation files? There's an AI out there you can just dab in some text and pop out some animations, it's just a 2D stick man with 3D data.

Let me know if you need this stuff thickly commented. I was hoping to get it 100% before I started writing comments like I know what I'm doing.
User avatar
tperry2x
Posts: 1533
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Platform Games with xTalk

Post by tperry2x »

Well, it's already a lot further than I ever got.
It turns out ChatGPT really isn't good at writing transcript / xtalk - it generates more errors than it solves.
User avatar
tperry2x
Posts: 1533
Joined: Tue Dec 21, 2021 9:10 pm
Location: Britain (Previously known as Great Britain)
Contact:

Re: Platform Games with xTalk

Post by tperry2x »

xAction wrote: Thu Feb 29, 2024 3:54 am As for that "Puzzle-Platformer" demo , sure we can do that, probably pretty easy.
Thanks for the suggestion, actually.
No problem at all. I find these hugely informative and interesting, even if most of the calculations are completely over my head.

I can always come up with suggestions.
How about creating something that plots an arc of a bullet, with an attempt to make something like this:

https://m.youtube.com/watch?v=tIvcqrPMF ... BjbGFzc2lj
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Platform Games with xTalk

Post by xAction »

AI requires fine tuning with BILLIONS of data inputs. Unless we produce a billion lines of code it's never going to be good at xTalk. Codeium won't even touch it because it's GPL. :( But LLM at home is coming with NVIDIA chipsets so there's hope.
The way all the code is locked up in stacks AI has no access to it by scraping the web. It's super convenient for us to have it in the stack (or a button, or graphic, etc) instead of chasing files, but probably time to start squeezing all the code out into a git somewhere. Wonder how many lines of code the IDE itself has.

As for the Arc of Doom, I believe that is a product of pi (actually sine and cosine) so I'll discuss that in the circles thread.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests