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 Classic Chat / AGK code challenge

Author
Message
MadBit
VIP Member
Gold Codemaster
14
Years of Service
User Offline
Joined: 25th Jun 2009
Location: Germany
Posted: 8th Mar 2017 13:12
I am busy at the moment.
I would like to commit the start of a new challenge to someone.
Share your knowledge. It\'s a way to achieve immortality. (Tenzin Gyatso)
Pixie-Particle-Engine
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Mar 2017 13:15 Edited at: 8th Mar 2017 14:44
OK, I'll take it just so that we can get the ball rolling ....
Let's go with the Tech Demo suggestion.

It's all a bit open as to what you can do and openness does seem to put people off but there has been a lot of thumbs up for the suggestion, so go for it!

Create a tech demo that shows off objects, sprites or text doing 'funky' things!
Make it modular - I want to be able to merge them all together at the end into a single demo
A function that is called once, does everything it needs to and then exits
Name the function profilenameTechDemo
Two weeks is the usual time frame so let's say Wednesday 22nd at midnight GMT

Quote: "Can we use shaders for this challenge?"

No, that would involve loading them in and one of the main rules of these challenges is that there is no loading of external media.
AGK V2 user - Tier 1 (mostly)
Ranietz
AGK Gold Backer
19
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 8th Mar 2017 14:18
Quote: "
Quote: "Can we use shaders for this challenge?"

No, that would involve loading them in and one of the main rules of these challenges is that there is no loading of external media."


That's fine. Off to youtube for some inspiration.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Mar 2017 14:43 Edited at: 8th Mar 2017 14:45
I'll use this framework for the final merged project so you can see how yours needs to work:


Put everything in a function that has a synced loop in it. Name your function profilenameTechDemo() and let it run for however long it needs to (no more than a minute, we don't want people to get bored). Then exit smoothly, so fade things out or use a wipe ready for the next persons to run.
AGK V2 user - Tier 1 (mostly)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 8th Mar 2017 15:39
Ideally, no. But I used one in my last challenge. Because it was only about 4 lines of code in the shader, I created the shader with code and saved it locally when the program ran. The challenge entries have to be able to just copy n' paste into the IDE without downloading anything.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 8th Mar 2017 15:54
can we use other functions if we name them appropriately?
fubar
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Mar 2017 16:39
Quote: "can we use other functions if we name them appropriately?"


That implies that you use inappropriate names for your functions
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 8th Mar 2017 17:07
Quote: "That implies that you use inappropriate names for your functions "

HAHA I probably do allot of the time
but figure if we have to have the code all in one function ie for me fubarpkTechDemo then other functions I may use should also prefix my name
but I didn't notice the includes meaning they can be complete programs. Not just a function which I first understood it to be
fubar
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 8th Mar 2017 20:27
Other functions are fine as long as I can call the code from just the one.
The includes are in the framework that I'm going to use to put everyone's demo together. You can't include other files yourself because your code needs to be cop/pastable from the forum
AGK V2 user - Tier 1 (mostly)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 9th Mar 2017 00:03
So have we decided? Old skool demo?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 11th Mar 2017 04:46 Edited at: 12th Apr 2018 22:40
not sure that I like it but here's my attempt

fubar
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Mar 2017 08:02
@fubarpk: I love that! The bars coming in from the sides looks ridiculous! (I mean ridiculously good, not just ridiculous. )
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 14th Mar 2017 14:33
Thanks CJB
Was trying to restrict the whole process to around a minute
so as when Scraggle puts everyone's in one single demo it didn't take too long
So I sped everything up somewhat

How is everyone elses demos going ?
fubar
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 14th Mar 2017 14:37
Haven't started, but have an idea of what I'm going to do. I WILL enter this time!
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 14th Mar 2017 15:42
I'm going to try to find some time this weekend to knock something up
AGK V2 user - Tier 1 (mostly)
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 15th Mar 2017 17:56 Edited at: 15th Mar 2017 23:19
Haven't had a chance to yet, been busy working on other libraries; improved base64 decryption, a new xml parser, and tmx importer.

I might have to steal your fubarpkCreateEllipse function. Grabbing images without grabbing the background, very handy!

I have an idea for the next challenge after this..... zlib decompression! I'll also settle for gzip

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2017 02:53
Your very welcome to the function Phaelex
The SetClearColor (red,green,blue) is a very useful command
So is the SetSpriteTransparency ( iSpriteIndex, mode ) command

Quote: "Looking forward to seeing all the creations, learning some new tricks and be inspired to create something new."


My creation this time is really just a cut down recreation of something I made while everyone was working on a file handler
which inspired me to make a new game which is kinda fun and very suitable for touchscreens
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 16th Mar 2017 15:16
Here's a clip of what I have so far.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 16th Mar 2017 22:42
Looking good Phaelax nice to see old skool stuff
I went with the Atari STE in that era
good ole 68000 programming was used for these demos back then I believe

You may be interested in one of my old skool friends is bringing retro back to life
He has a room which has so far an Apple 2, Atari st , and Amiga so far all working
ofcourse he's a strong believer that people should start hence his kids to learn
programming without all the benefits the new languages have but I did convince him
to purchase AppGameKit and he may also have a play with GDK as hes a fluent c programmer
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2017 16:50
Here's my entry so far. It's by far some of my sloppiest code in a long time! I had no clue what direction I was going so I'm sure I have code mixed in there that isn't even being used.


"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2017 16:50 Edited at: 17th Mar 2017 16:52
Kept getting "An unknown error occurred!" while trying to post.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2017 16:51 Edited at: 17th Mar 2017 16:52
Kept getting "An unknown error occurred!" while trying to post.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Attachments

Login to view attachments
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 17th Mar 2017 21:59 Edited at: 17th Mar 2017 22:01
don't forget
Quote: "Put everything in a function that has a synced loop in it. Name your function profilenameTechDemo()"

any functions should also prefix the same as the whole lots is being put into a demo of everyones at the end
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Mar 2017 23:33
So I take it I need to add in a control to end the loop? Arghh yall making me work too hard

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 23rd Mar 2017 12:21
I was hoping there would be allot of entries by now.
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 23rd Mar 2017 12:51 Edited at: 23rd Mar 2017 12:56
Yea I'm not going to be able to meet the requirement of putting it all inside a function. I have Types which can't be declared in functions.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Mar 2017 14:07
Quote: " I have Types which can't be declared in functions."

They don't need to be.
Put them at the top of your file. I will include the file and your types will be accessible.

I just need to be able to call PhalaexTechDemo(). The function could just be a list of other functions that get called in turn if you wish.
AGK V2 user - Tier 1 (mostly)
Ranietz
AGK Gold Backer
19
Years of Service
User Offline
Joined: 2nd Sep 2004
Location: Norway
Posted: 23rd Mar 2017 14:17
I've been dead tired from work the last couple of weeks so I wont be making this one. Maybe the next one.
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 23rd Mar 2017 15:09
I haven't had time to do anything with this either.
I'd like to extend the deadline to try to get some more participants.
So unless anyone has any major objections, I'll give until Sunday night to get the submissions in
AGK V2 user - Tier 1 (mostly)
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 24th Mar 2017 21:02 Edited at: 12th Apr 2018 22:42
I have already submitted my entry but I thought these routines might be handy to someone.
They really are only useful to demos or fading in and out background sprites. There are 4 functions
the minimal remarks in each function should explain better.


the example code I used them in is below. The functions showcase the set Spritedepth and Copyimage commands utilizing sprites passed

the fadein2 function is a great way of bringing a title of a game fading it in using a circular approach
try them if your interested hard to explain. The images you will need to use formy code are two background full screen size images
and an ellipse the ellipse itself being totally transparent while its borders are set to something like rgb (0,0,1) I might a fairly large
one that way when it was resized it didn't pixelate too much
fubar
Preben
AGK Studio Developer
19
Years of Service
User Offline
Joined: 30th Jun 2004
Location:
Posted: 24th Mar 2017 23:29
What about shaders only , is that allowed ?
best regards Preben Eriksen,
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th Mar 2017 10:38
Very disappointing!
Only one complete entry and one partial entry.

I declare fubarpk the winner be default.

There's no point smooshing the entries into a single file since there is only one.
AGK V2 user - Tier 1 (mostly)
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 27th Mar 2017 13:14
yeh it was a bit disappointing but il take the win, money can be sent through my paypal account

Ide like to hand it back to the group to discuss what they'd like in the next challenge
fubar
tmu
7
Years of Service
User Offline
Joined: 2nd Feb 2017
Location:
Posted: 28th Mar 2017 13:11
Cool thread. I see many old-schooler demo-style here. Is this one of those places where old sceners come to nostalgize and try to bring back the glory days ?

If so, can we have some Glenz Vectors, Copper plasma, etc.!!?

Cheers all,
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Mar 2017 17:36
I wouldn't say mine was incomplete, I just didn't wrap into a tidy function..... or have the animation ever end. Weather was too nice over the weekend for me to sit at computer :p

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
damothegreat
User Banned
Posted: 28th Mar 2017 17:50
Hello

I see that "tmu" has newly member inputted in the thread and with quite a cool ideas

This thread is open to everyone and anyone (and if its ok, including me) when I can get time.

I'm not a good people person, but I do know that I love to code, so that's all I'm going to do going forward


Damo

damothegreat
User Banned
Posted: 28th Mar 2017 19:32
A good one might be is to do is a pack of card image creator which automatically generate 52 cards, 4 suits, purely from draw, get image commands and then enter them into sprite frames
of 52 x 4 images

Like CLUBs would be created by 3 DrawEllipse commands

Diamonds would be a drawbox, shrunk on the X axis then rotated 45 Degs and get image

CreateText would be for the numbers on each corner and rotated 180 for the bottom corners

Anyway

This is not set in stone.. Just an idea




damothegreat
User Banned
Posted: 28th Mar 2017 22:29
A Dart Board perhaps?

You will need to develop some quad + points and filler for this one - this is challenging or is it?..

fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Mar 2017 03:53
Welcome tmu

Here we produce anything that can be possibly produced without loading any media.
All suggestions welcome.

Good suggestions so far keep them coming in
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 29th Mar 2017 14:58
2 hours later, I forgot why I was even on https://www.codewars.com/. I was looking for challenge ideas and got sucked into the zone of coding one after another, lol. Pretty fun website. It's like Project Euler if you're familiar with that, but more game-oriented. (achievements and whatnot).


How about a physics demo? Without using physics commands?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 29th Mar 2017 21:42
Ideas so far

1>tmu........can we have some Glenz Vectors, Copper plasma, etc.!!?
2>damo.......A good one might be is to do is a pack of card image creator which automatically generate 52 cards, 4 suits, purely from draw, get image commands and then enter them into sprite frames
of 52 x 4 images
3>damo.......A Dart Board perhaps?
4>phaelax....How about a physics demo? Without using physics commands?

I like the idea of a physics demo without physics commands but i for one would find that hard

I tried to write my own falling snow routine that built up snow when it collided with objects
like i have seen in some past games. (using draw commands and copy images etc) but it was a dizmal attempt

Keep the ideas coming and wel see if we can get more people in this one by perhaps voting on the suggestions
fubar
damothegreat
User Banned
Posted: 30th Mar 2017 06:14
Hmmm manual physics system.

I.E. 100 or so balls in a funnel at the top heading down to a rotating wheel in the centre of the screen, this wheel will have platforms attached to the outside of the wheel, these rotate too.

The balls head down the funnel into the wheel with platforms, which obviously bounce about until the find the exit point on the wheel.

Interesting and funky demo...

I have a free day Friday and weekend, so ill have a go
damothegreat
User Banned
Posted: 30th Mar 2017 18:30 Edited at: 30th Mar 2017 18:44
Something to get you started



Damo
damothegreat
User Banned
Posted: 1st Apr 2017 16:56
Something different to get you started



Damo
damothegreat
User Banned
Posted: 1st Apr 2017 21:18 Edited at: 1st Apr 2017 21:27
Sorry chaps - here is another idea.

The starting of a PerPixel one if interested,



When you hover over two of the ellipses which are converted to sprites, it will draw a box with colours to go to another command which will
check the rectangular area for per pixel collisions.

Good for 2D road racing games

Its not finished, but you get the idea once I get some more to you and if you wish to use it for a AppGameKit Challenge then by all means carry it on

hint... Best way to check per pixel on PNG, is to create your PNGs with a transparency and anything with 0 transparency Is not flagged as collision, anything higher than 1 is set to have collisided


Damian
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Apr 2017 22:29 Edited at: 5th Apr 2017 22:35
I have a suggestion for a challenge that's more logic orientated than anything. I'll just copy the instructions from codewars, it was a kata I recently completed.

Quote: "
This problem takes its name by arguably the most important event in the life of the ancient historian Josephus: according to his tale, he and his 40 soldiers were trapped in a cave by the Romans during a siege.
Refusing to surrender to the enemy, they instead opted for mass suicide, with a twist: they formed a circle and proceeded to kill one man every three, until one last man was left (and that it was supposed to kill himself to end the act).
Well, Josephus and another man were the last two and, as we now know every detail of the story, you may have correctly guessed that they didn't exactly follow through the original idea.
You are now to create a function that returns a Josephus permutation, taking as parameters the initial array/list of items to be permuted as if they were in a circle and counted out every k places until none remained.

Tips and notes: it helps to start counting from 1 up to n, instead of the usual range 0..n-1; k will always be >=1.

For example, with n=7 and k=3 josephus(7,3) should act this way.
"



So our final result is:



The template for this would be:

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
damothegreat
User Banned
Posted: 5th Apr 2017 22:49 Edited at: 5th Apr 2017 23:01
First impression --- Uh

But then find the missing number in sequence and add to the result ing array sequence and repeat until they all found all of them and put them in order

lol!!! - Ill have a go at weekend

Where is my bubble sort algorithm lol
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 7th Apr 2017 02:16 Edited at: 7th Apr 2017 02:30
Perfect example for the use of a doubly linked list
just traverse through every 3rd one you pop out the list and insert at the end of a new list
the fact double linked lists link back to the front a very small loop would be needed to complete this task

I might sit this one out as i've already done the same task in C++ set by a lecturer. and I think linked lists
do it much neater
fubar
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Apr 2017 15:17
I have another challenge to present, assuming anyone still has interest here.

Given an array of integers, determine who has the most bits; odd or even. Here's the catch, odd numbers shall only count their 1 bits and even will count the 0 bits. Even numbers will also NOT count any leading 0s in the binary.

30 = 1110 (not 000000000000000000000000000011110)
Thus it's total number of bits is 1. (even count the non-leading zeros)

Add up the total bits for odd and even numbers as explained and determine which has more. Function should return a string of either "odds win", "evens win", or "tie".

Here's is a starting template.


Java makes this entirely way too easy with its Integer class. Do you have what it takes to become a bit code master?

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
fubarpk
Retired Moderator
19
Years of Service
User Offline
Joined: 11th Jan 2005
Playing: AGK is my friend
Posted: 18th Apr 2017 00:31 Edited at: 12th Apr 2018 22:44
I think the idea is to get decimal numbers have their binary bits added but I need to work on a better decimal to binary converter before I can add there bits

this code seemed to work fine in c but seems to only be correct some of the time using agk syntax



if the above worked which could also be modified to count the bits
fubar

Login to post a reply

Server time is: 2024-04-19 05:45:58
Your offset time is: 2024-04-19 05:45:58