Search found 336 matches

by matteus
Thu Sep 15, 2016 8:47 am
Forum: SGDK
Topic: Function to generate random within specific range
Replies: 4
Views: 942

Function to generate random within specific range

Code: Select all

u16 randomNumberGenerator(u16 finishInt) {
    u16 x = 0;
    do {
        x = random();
    } while (x <= 0 || x > finishInt);
        return x - 1;
}
Is this the best way to be doing it?

u16 randomNumberGenerator(10) would give me random 1 to 10
by matteus
Wed Sep 14, 2016 8:24 am
Forum: SGDK
Topic: sprintf speed nightmare
Replies: 8
Views: 1541

sprintf speed nightmare

sprintf(Verse1.charLine1, "%s %s", Lyrics.charLine1Part1[randomNumberGenerator(10)], Lyrics.charLine1Part2[randomNumberGenerator(10)]); sprintf(Verse1.charLine2, "%s %s", Lyrics.charLine2Part1[randomNumberGenerator(10)], Lyrics.charLine2Part2[randomNumberGenerator(10)]); sprintf(Verse1.charLine3, "...
by matteus
Tue Sep 13, 2016 8:36 pm
Forum: SGDK
Topic: random number seeding issue
Replies: 14
Views: 3085

Re: random number seeding issue

Is there a way around this? :D
by matteus
Mon Sep 12, 2016 7:56 pm
Forum: SGDK
Topic: random sort
Replies: 4
Views: 1013

Re: random sort

Thank you both! :)
by matteus
Mon Sep 12, 2016 5:47 pm
Forum: SGDK
Topic: random sort
Replies: 4
Views: 1013

random sort

I've an array of numbers 1 to 20 and i'd like to randomly sort them :) What's the best sort to use with the SGDK?
by matteus
Mon Sep 12, 2016 5:42 pm
Forum: SGDK
Topic: structs with unions
Replies: 4
Views: 1020

Re: structs with unions

Thanks! I might give that a go!
by matteus
Wed Sep 07, 2016 8:23 pm
Forum: SGDK
Topic: structs with unions
Replies: 4
Views: 1020

Re: structs with unions

answered my own problem as per usual :D (okay not as usual) lol
by matteus
Wed Sep 07, 2016 7:27 pm
Forum: SGDK
Topic: structs with unions
Replies: 4
Views: 1020

structs with unions

Does the SGDK support unions? I can't get this code to work!! struct Script { char type; union { struct { char charName[24]; char charDialogue[480]; } CharacterDialogue; struct { char menuItem1[24]; char menuItem2[24]; char menuItem3[24]; char menuItem4[24]; char menuItem5[24]; char menuItem6[24]; }...
by matteus
Mon Feb 29, 2016 9:40 am
Forum: SGDK
Topic: two dimension char array
Replies: 13
Views: 3105

Re: two dimension char array

I just wanted to confirm I now put this in rom by declaring it static. In fairness I hadn't noticed in code that I wasn't!

I'm using the array to store conversation. There is a fair bit of wastage as not every piece of discussion populates it's full allocation
by matteus
Wed Feb 24, 2016 11:39 pm
Forum: SGDK
Topic: two dimension char array
Replies: 13
Views: 3105

two dimension char array

I think I've hit a limit but wanted someone to confirm it!

what is the biggest static char array I can declare?

Code: Select all

char Conversation[8][300];
by matteus
Wed Feb 10, 2016 11:26 pm
Forum: SGDK
Topic: Is it possible to 'scale' sprites?
Replies: 25
Views: 6542

Re: Is it possible to 'scale' sprites?

Jon Burton is quoted as saying this in an interview that interests me :) The title was released for Mega Drive and SNES in late 1994, with an expanded version released for the Mega CD shortly after. Burton comments that the CD format offered the company the chance to push their games further. “We lo...
by matteus
Wed Feb 10, 2016 11:18 am
Forum: SGDK
Topic: Project - Mega Bargin Hunters - Help / Updates
Replies: 13
Views: 3079

Re: Project - Mega Bargin Hunters - Help / Updates

I think I've a bug in my code somewhere! This code does not fade in smoothly it flickers? memcpy(&palette[0], layout_image.palette->data, 16 * 2); memcpy(&palette[16], Lots[LotItems[0]].LotPortrait->palette->data, 16 * 2); memcpy(&palette[32], Experts[0].Portrait->palette->data, 16 * 2); memcpy(&pal...
by matteus
Thu Jan 14, 2016 2:20 pm
Forum: SGDK
Topic: Project - Mega Bargin Hunters - Help / Updates
Replies: 13
Views: 3079

Re: Project - Mega Bargin Hunters - Help / Updates

Haha its the checker plate isn't it? Infact the whole thing looks like it! Lol
by matteus
Wed Jan 13, 2016 10:58 pm
Forum: SGDK
Topic: Project - Mega Bargin Hunters - Help / Updates
Replies: 13
Views: 3079

Re: Project - Mega Bargin Hunters - Help / Updates

Another brief update I've been offering friends and family the opportunity to star in game in exchange for the cost of the pixel art :) so you'll notice several portraits have changed. https://www.youtube.com/watch?v=MNabRi1fwhM&feature=youtu.be The plan is to replace them all :) I've 60 in game ite...