Jump to content


Camman

Member Since 18 Mar 2006
Offline Last Active Apr 24 2013 12:18 AM

Topics I've Started

Blackjack (21)

15 April 2013 - 12:35 AM

Blackjack (21)

Description
 
Play the classic blackjack (sometimes known as 21) game, right in your browser! Try to get as close to 21 as you can without going over. You must also beat the score of the dealer who must hit on a soft-17 (ex: an ace and a 6). 

Features include saving the chip balance between game sessions as well as statistics about previous hands (wins, losses, pushes, busts, blackjacks, hands played). You can also enable/disable asking for insurance and surrendering in the settings menu.
 
Screenshots
 
ss1.png
 
Play Now!


Shuffle Script

14 March 2013 - 05:04 AM

It's been a while since I've asked a question here. Anyway here we go! I'm writing a shuffle script that takes a 1-dimensional array that represents a deck of cards and shuffles them randomly and returns a ds_stack. Note that before the shuffle script is called I am initializing the array that is passed in the first argument like so:
count = 0;
for (suit = 0; suit < 4; suit++)
{
    for (face = 0; face < 13; face++)
    {
        temp = ds_map_create();
        ds_map_add(temp,"suit",suit);
        ds_map_add(temp,"face",face);
        deck[count] = temp;
        count++;
    }
}
Here is the shuffle script
/* Shuffles a deck and returns a deck stack
shuffle_deck(deckArray)

arg0 - the deck array
returns a stack (of the deck)
*/

var shuffleAmount, card1pos, card2pos, deckArray, temp;
var deckStack;

deckArray = argument0;
shuffleAmount = irandom_range(500,1500);

for (iii = 0; iii < shuffleAmount; iii++)
{
    card1pos = irandom(51);
    card2pos = irandom(51);
    
    if (card2pos == card1pos)
    {
        card2pos++;
    }
    
    temp = deckArray[card2pos];
    deckArray[card2pos] = deckArray[card1pos];
    deckArray[card1pos] = temp;
}

deckStack = ds_stack_create();
for (iii = 0; iii < 52; iii++)
{
    ds_stack_push(deckStack,deckArray[iii]);
}

return deckStack;

The issue is that I am receiving the following error when I run the game:
___________________________________________
FATAL ERROR in
action number 1
of Create Event
for object oController:

############################################################################################
VMError!! Occurred - Push :: Execution Error - Variable Index [0,25] out of range [0,-1] - -7.deckArray(100005,25)
 at gml_Script_shuffle_deck (line 23) - 	temp = deckArray[card2pos];
############################################################################################
############################################################################################
Local Variables : 
deckArray(100005) = 0
shuffleAmount(100006) = 1380
card1pos(100008) = 36
card2pos(100009) = 25
Self Variables : 
count(100000) = 52
suit(100001) = 4
face(100002) = 13
temp(100003) = 51
iii(100007) = 0
Global Variables : 
unshuffledDeck(100023) = 0
stack frame is
gml_Script_shuffle_deck (line 0)
called from - gml_Object_oController_Create_0 (line 2) - arg0 - the deck array

I'm not sure what is causing the problem. Can anyone offer some assistance, please?

Thanks!
Cameron

Asteroids: Unlimited

31 May 2012 - 07:14 AM

Posted Image

Download on Google Play

Asteroids Unlimited is a arcade-style asteroid shooting game! Rack up your score by blasting incoming asteroids into pieces. Just make sure they don't hit your ship, or else you could be lost in space forever! How long can you last?As your score increases, the difficulty increases as well! There are power-ups like "Liquid Nitrogen", "Invincibility", and even a shield for your ship to help as the game gets harder!

Features

  • 15 Levels with Increasing Difficulty
  • Choose your own ship color
  • High Scores
  • Weapon Overheating
  • Defensive Shields
  • "Invincibility" Power-Up (Makes you invincible for 5 seconds).
  • "Liquid Nitrogen" Power-Up (Cools your weapon down, and keeps them cooled for 5 seconds).


Screenshots

Posted Image




PhotoSlider

25 May 2012 - 05:02 AM

Posted Image

Download from Google Play

PhotoSlider is a picture puzzle game! Challenge yourbrain by trying to solve each puzzle as fast as you can, inas few moves as possible!
The object of the game is to slide the tiles using the empty space to complete the picture.

Posted Image
Posted Image
Posted Image

PhotoSlider comes with 18 different puzzles for you to solve. (More coming soon!)

There are also a number of animated puzzles that you can try your hand at, if you think you're up for the challenge!



Change Log

Version 1.1.3
  • High Scores (time based and move based) - Had to wait for ini_* functions to work in Studio
  • 12 New Puzzles!
  • 3 Difficulty Levels
    Easy - > 3x4 puzzle
    Medium -> 4x4 puzzle
    Hard -> 5x5 puzzle

ini_* Functions

24 May 2012 - 02:21 AM

Is anyone else having problems with the ini_* functions in Studio? Here's an example of something that should work, but doesn't:


ini_open(working_directory+"\highscores.ini");
ini_write_real(global.puzzleName+"_"+global.theDifficulty,"Moves",global.highMoves);
ini_close();