Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit/AppGameKit Studio Showcase / [SOLVED] WIP: top down 2d racer. Bit of assistance required if anyone has any ideas?

Author
Message
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 9th Aug 2020 11:57 Edited at: 9th Aug 2020 17:02



Hi All

I'm having a bit of a play with AppGameKit (the last time I coded anything was on the Amiga, so it's been a bit of a break!), and thought I'd try a top down 2d racer for android... with the slight twist being it's controlled by tilting the phone and keeps an upright orientation.

It's still very early days, but I'm a bit stumped as to how best 'fill' the procedurally generated track. Ideally some kind of fast 2d polygon would do it I think, but alas I can find no such thing

Should I go back to the drawing board and figure something out with sprites?

Also.. how on earth do I get the video to embed?!


Ta

R.

Attachments

Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 9th Aug 2020 15:58 Edited at: 9th Aug 2020 16:02
[video=youtube]code here[/video]

where "code here" put the id of your video 'CAR4jpm8Wdw'

Your game is looking good, I like the drifting action on the bends, very cool.
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 9th Aug 2020 17:04
Ah... thank you. Video embedded successfully!
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 9th Aug 2020 17:40 Edited at: 9th Aug 2020 17:43
This post has been marked by the post author as the answer.
i've wanted to make similar and expect THIS could help?

no personal experience with the functions but i imagine it should do what you want, as i understand it.
[AGK Resource Directory] | [TGC @ GitHub]
[My Itch.io Home]
[CODE lang=AGK] Your Code Here [/CODE]
[VIDEO=youtube] VideoID [/VIDEO]
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 9th Aug 2020 22:51
Awesome, Thanks. I'm not sure about the first one (looks like it may be a bit slow for real time), but Bengismos shader on there looks almost perfect for what I need. Hmm now I have to figure out how to run/convert his tier 2 code in tier 1! That's my next few days gone. Seems a bit odd theres not a built in function for this, I would have thought it was quite a common thing to need.
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 9th Aug 2020 22:57
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 10th Aug 2020 10:16
Yay that looks like a built in way that I completely missed!

Many thanks, I'll have a play with that a bit later today.
Richard Stevens
4
Years of Service
User Offline
Joined: 14th Jan 2020
Location:
Posted: 10th Aug 2020 21:28 Edited at: 10th Aug 2020 23:22
Whoooa... so that SetSpriteUV() thing sent me off on a wonderful mathematical google journey that was far too complicated for my small chimpanzee brain with it's D grade in GCSE maths to comprehend.

I remember clearly thinking in lessons how useless trigonometry was in the real world, and how I'd never need it, so i won't pay attention. Yes, never mind...

So anyway, I think I've got Bengismos shader working, so many thanks to Bengismo should you happen to come across this thread.

I had to fiddle with it a bit to get it going, so I'll pop it in here in noob friendly format for anyone else that's thinking a combination of "I need fast filled 2d polygons" along with "whats a shader?".

so first up, stick this is a text file and save it in your media folder as vertex.vs



then stick this in a text file and save it as pixel.ps in your media folder


then a quick demo:



This gets me over 1000 filled quads at 60fps on my lowly laptop, which is ample for my needs.

yay.. has hit my fps a bit but is turned on for the whole track at the mo.

Login to post a reply

Server time is: 2024-11-23 09:30:52
Your offset time is: 2024-11-23 09:30:52