Basic Random Numbers Example

Here you may post tutorials you have made about using DS Game Maker.

Basic Random Numbers Example

Postby CrashingThunder » Sun Mar 07, 2010 4:19 am

I'm fairly new to this program and this forum, but I have some experience with coding in general so I decided I'd start by learning the basics and decided to do some stuff with random numbers...HENCE, I decided to create "The Matrix" xD

Code: Select all
Set Text Color for All 0;0;31;0 //makes the text green
Declare Room Global t;Whole Number;0 //sets our number to be displayed
Set Variable t;PA_RandMinMax(0,1) //sets t to a random number between 0 and 1
Draw Variable 0;PA_RandMinMax(0,31);PA_RandMinMax(0,23);t //draws t to a random x tile(0-31) and y tile(0-23)


And thats it! This will result in green 0s and 1s being drawn and random coordinates! Here's the file if you're extremely lazy and want to see it in action first...
Attachments
Matrix.nds
The Matrix .nds file
(336.56 KiB) Downloaded 32 times
matrix.xds
The Matrix .xds file
(506 Bytes) Downloaded 18 times
Last edited by CrashingThunder on Sun Mar 07, 2010 7:16 am, edited 1 time in total.
The early bird may get the worm, but the second mouse gets the cheese in the trap
User avatar
CrashingThunder
 
Posts: 41
Joined: Sat Mar 06, 2010 9:29 pm
Current Project: Piano DS

Re: Basic Random Numbers Example

Postby Eldude » Sun Mar 07, 2010 7:12 am

Posting the .nds is always nice as well.
If you do not like my post, PM me to let me know and I will edit it.
Available to program your game.(not help you program it)
PM me your proposals. I want to see graphics and story as a minimum.

My Scratch Page: http://scratch.mit.edu/users/Eldude
Image
User avatar
Eldude
 
Posts: 5799
Joined: Thu Jun 26, 2008 9:46 pm
Location: A good place!
Current Project: Coding for one of you!

Re: Basic Random Numbers Example

Postby CrashingThunder » Sun Mar 07, 2010 7:17 am

.nds file added!
The early bird may get the worm, but the second mouse gets the cheese in the trap
User avatar
CrashingThunder
 
Posts: 41
Joined: Sat Mar 06, 2010 9:29 pm
Current Project: Piano DS

Re: Basic Random Numbers Example

Postby WinterAce » Sun Mar 07, 2010 10:10 am

This can also be used by replacing t with a 8 px sprite strip of different colors, and using multiple PA_RandMinMax's and Create Sprite/Move Sprite to move the squares around. SpecialFX!
Visit my blog: WinterAce.co.cc
User avatar
WinterAce
 
Posts: 639
Joined: Sat Feb 28, 2009 8:57 am
Location: On yer screen!
Current Project: Brushing up my C skills

Re: Basic Random Numbers Example

Postby AlceX » Sun Mar 07, 2010 7:28 pm

Pretty nice but it doesn't look much like the Matrix.
"Dream a little dream."-Chevre(Animal Crossing:Wild World)

Finished Projects:Puzzle N01: To Bulban
Santa's Flight
Current WIP's: Turnip Merchant

My Deviantart Page
User avatar
AlceX
 
Posts: 770
Joined: Wed Nov 18, 2009 10:22 pm
Current Project: Turnip Merchant


Return to User-Submitted Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest