How to do some very basic things

Learn to use DS Game Maker by Example.

How to do some very basic things

Postby jadaradix » December 30th, 2010, 12:35 pm

Move Objects by Stylus
Every Object has a position (X and Y). The Stylus also has an X and Y of where it is touching. So all we have to do is set the X and Y of any Object to the Stylus X and Y in the Step event.

Use the action 'Set Object Position' in the 'Step' event, with these arguments:

Stylus.X - ([Width] / 2)
Stylus.Y - ([Height] / 2)

Stylus.dsgm


Move Objects by D-Pad
If the user presses Right, we must increase the X position. If they press Left, we must decrease it. If they press Down, increase the Y. Up, decrease the Y. So we are going to need 4 events for each (Button Held events).

For the Right event add the action 'Set Object Position' with these arguments:

[X] + 1
[Y]

This means use the previous X position + 1 (so move right) and the same Y position. We don't want to change the Y.

DPad.dsgm


Collecting Objects
Once again, let us think of this in a programmatical way. The user must be able to move the Object with the D-Pad (or Stylus). We already have the actions to do that above. If the Object collides with another (collidable) Object, this object must be destroyed. The score should also increase.

Start with the .DSGM project to use the D-Pad. Add a new Object and call it 'Pickup'. Give it the sprite 'Ball_Sprite' so that it is visible. Add an event to this 'Pickup': Collision > Ball.

In this event, we need 2 actions: To delete itself and make the score bigger. So add 'Delete Object'. Add 'Set Score' (from the 'Score' tab) and put in the box: score + 1

Now go into Room_1 and plot some more Pickup objects. It works!

Pickups.dsgm


Things to remember:

  • Think (on a low level) what you want to do. If you want to make the object move by the stylus or by the D-Pad, you are changing its position. So, the action, 'Set Object Position' is something to look at.
  • X is the horizontal direction and Y is the vertical direction, beginning at 0,0 which represents the top left of the screen
  • To increase the value of a variable (such as Score or an X Position), set it to itself plus 1
  • When Events fire, the Actions within it happen.
jadaradix
Site Admin
 
Posts: 895
Joined: December 30th, 2010, 3:23 am
Location: United Kingdom

Re: How to do some very basic things

Postby PrDrMrman » January 4th, 2011, 11:26 pm

I tried this, i had a sprite in the lower left corner some where and when i set these all it did was move my sprite to the top of the screen and i could only move it back and forth in increments of one space, but i could the the 2 space area im very frustrated being so bad at this and all :cry:
PrDrMrman
 
Posts: 10
Joined: January 4th, 2011, 11:22 pm

Re: How to do some very basic things

Postby jadaradix » January 4th, 2011, 11:49 pm

Attach your project so that I can help.

im very frustrated being so bad at this and all

Don't be disheartened - everything is based on these simple concepts; once you get it, you're ready to fly :mrgreen:
jadaradix
Site Admin
 
Posts: 895
Joined: December 30th, 2010, 3:23 am
Location: United Kingdom

Re: How to do some very basic things

Postby jace » January 5th, 2011, 12:00 am

Do you have to use below h line/v line for sprites?

Can you not just have a trip wire type thing?

Surely useing under H-line/V-line for sprites is just the same as if collision?
jace
 
Posts: 90
Joined: December 31st, 2010, 12:50 pm

Re: How to do some very basic things

Postby jadaradix » January 5th, 2011, 12:21 am

jace wrote:Do you have to use below h line/v line for sprites?

Can you not just have a trip wire type thing?

Surely useing under H-line/V-line for sprites is just the same as if collision?

You should create a new topic for this; it doesn't belong here.
jadaradix
Site Admin
 
Posts: 895
Joined: December 30th, 2010, 3:23 am
Location: United Kingdom

Re: How to do some very basic things

Postby Nobody » February 14th, 2011, 12:54 am

Hello people. I am new to DSGM and this is the first time doing anything dealing with programing. I hate the fact that there isn't a very good tutorial that can show you most of the basics. I would appreciate it if you guys made an update to DSGM so it has built in step by step tutorials or a at least a video tutorial of basic commands and what does what. If you want to get technical with the tutorials make a nds game using DSGM that teaches you how to make ds games and do the programing and what not. No offense, but to new comers like me this is way too confusing and with little help to teach you what to do it even crushes your programming dreams. :( someone please help me with all the basics :|
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby baron » February 14th, 2011, 7:20 pm

I thought this would be a good start: viewtopic.php?f=6&t=5
Have you played Sliker DS?

There's this cool new Android game that you should totally play.

http://officeofstrategicinfluence.com/spam/
User avatar
baron
Site Admin
 
Posts: 177
Joined: December 30th, 2010, 9:54 pm
Location: London, England

Re: How to do some very basic things

Postby Nobody » February 14th, 2011, 11:11 pm

Thanks. Helped a little, but this stuff i already figured out, or learned except for velocity. This reinforces what i meant. There is really only tutorials on how to do the extremely basic stuff. I want to learn how to use other commands to do other common things. I want to learn what actions do what, how, and examples where they can be used. For example like camera moving(i know this, but just saying), in game if button pressed progressing conversation and typing text(i can't figure this out), keyboard function (which i can't find), unlockables, leveling up a character, and so on. I hope i'm making sense
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby petermiami » February 18th, 2011, 3:42 am

hello my name is peter i wood to know how do you make a game i rely love games so i wood like to make one and how do i do this i try but i dont know what to do i guess i am kids dumb here lol but um ty for helping me and gb you and i dont rely get all of this i dont even know what to put its name -_-
petermiami
 
Posts: 1
Joined: February 18th, 2011, 2:38 am

Re: How to do some very basic things

Postby Nobody » February 19th, 2011, 1:15 am

petermiami wrote:hello my name is peter i wood to know how do you make a game i rely love games so i wood like to make one and how do i do this i try but i dont know what to do i guess i am kids dumb here lol but um ty for helping me and gb you and i dont rely get all of this i dont even know what to put its name -_-

i can attempt to help you. i'm not very good myself but i can do a lot of simple things that can make a basic cheesy game. I'm thinking about making a game that shows people how to work DSGM for people like me and others. It will be like a simulator and stuff. Does that sound like something that would interest you?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby MadScientistMan » April 3rd, 2011, 3:50 pm

I've got a problem !

When I test the game before saving the project it works fine, however when i test it afterwards, it doesn't compile correctly!

Can somebody help :?:
MadScientistMan
 
Posts: 1
Joined: April 3rd, 2011, 3:39 pm

Re: How to do some very basic things

Postby Nobody » April 6th, 2011, 11:20 pm

MadScientistMan wrote:I've got a problem !

When I test the game before saving the project it works fine, however when i test it afterwards, it doesn't compile correctly!

Can somebody help :?:

This isn't the best place to post your question. For the best results you should re-post this under help
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby Foxi4 » April 7th, 2011, 1:54 am

MadScientistMan wrote:I've got a problem !

When I test the game before saving the project it works fine, however when i test it afterwards, it doesn't compile correctly!

Can somebody help :?:

Why won't you just use the compiled file from the Test then?
It's in the project temp folder.
Current Projects:

FalloutDS: Postponed until proper libraries are created, 10%
Foxi_Lib: A completely revised version of NitroSprites[FINAL], NitroBackgrounds and NitroText[FINAL], 40%
Foxi4
 
Posts: 1221
Joined: December 31st, 2010, 3:25 am

Re: How to do some very basic things

Postby nicklausw » June 29th, 2011, 5:47 pm

It moved a bit, and then froze. couldn't use again.
my stuff
pong - sms/gb
sudoku - sega master system

next project - something for the nes, perhaps?[/b]
User avatar
nicklausw
 
Posts: 1037
Joined: May 23rd, 2011, 10:25 pm
Location: The Capital Wasteland

Re: How to do some very basic things

Postby Nobody » June 29th, 2011, 5:57 pm

EpicThings wrote:It moved a bit, and then froze. couldn't use again.

Couldn't use what? The DSGM or the code?
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby nicklausw » June 29th, 2011, 11:02 pm

Nobody wrote:
EpicThings wrote:It moved a bit, and then froze. couldn't use again.

Couldn't use what? The DSGM or the code?
The Sprite. It didn't move, after I held the right button once. I just don't get it. :cry:
my stuff
pong - sms/gb
sudoku - sega master system

next project - something for the nes, perhaps?[/b]
User avatar
nicklausw
 
Posts: 1037
Joined: May 23rd, 2011, 10:25 pm
Location: The Capital Wasteland

Re: How to do some very basic things

Postby Nobody » June 30th, 2011, 3:40 am

Did you put it in the wrong event? If you want it to move continuously you have to put it in the button held event not the button press. DSGM runs at 60 steps per second(reads code 60 times a second), and button press works for the 1 step it happens. The button held registers for multiple steps as long as it's held for that step.
Feel free to ask me for help. I'm on the forum a lot.

Recent Projects:
Retro Ducks: viewtopic.php?f=13&t=3533 (latest)
The Living Dead 2: viewtopic.php?f=13&t=3483
Crafters DS (Minecraft 2D Clone!) viewtopic.php?f=13&t=3082
User avatar
Nobody
 
Posts: 2323
Joined: February 14th, 2011, 12:08 am
Location: United States of America

Re: How to do some very basic things

Postby nicklausw » July 1st, 2011, 7:11 pm

I did put button held... I guess I'll try again.
my stuff
pong - sms/gb
sudoku - sega master system

next project - something for the nes, perhaps?[/b]
User avatar
nicklausw
 
Posts: 1037
Joined: May 23rd, 2011, 10:25 pm
Location: The Capital Wasteland

Re: How to do some very basic things

Postby Andreson » March 21st, 2012, 10:05 am

Great info and admirable links, i really appreciate your post keep up the good work. Awesome share indeed. I’ve been awaiting for this update.
Andreson
 
Posts: 1
Joined: March 21st, 2012, 10:01 am


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest