Game Maker Community YoYo Games

Welcome Guest ( Log In | Register )

> Tutorials Rules

This forum is for clear and concise tutorials and well documented examples. Tutorials and examples posted here must follow the format in the pinned Rules and Guidelines.

All new topics must be approved by a moderator before they appear. Don't post twice!

 
Reply to this topicStart new topic
Mini-map Example, Not Registered - Over 100 Downloads!
jimn346
post Sep 26 2009, 05:40 PM
Post #1


GMC Member
Group Icon

Group: GMC Member
Posts: 170
Joined: 13-April 09
Member No.: 131573



  • Title: Mini-Map Example
  • Description: A simple and easy to edit mini-map example
  • GM Version: GM7.gif
  • Registered: No
  • File Type: .gmk
  • File Size: 19.2 KB (19,687 bytes)
  • File Link:
  • Screenshot:


To change the size of the map, change the constant map_size in the global game settings. The lower the variable, the larger the map.

Please post reviews. wink1.gif

List:
CODE
/*
---Constants---

To change constants, open up the Global Game Settings, go to Constants,
and you can change the constants. The map size gets larger when the map_size
constant is made smaller.

---Codes---

-Draw Event-

First, you need to put in the code that draws the sprite so that the automatic
drawing isn't overwritten by the map.

If you have Pro...

draw_sprite_ext(sprite_index,image_index,x,y,image_xscale,imag
e_yscale,
image_angle,image_blend,image_alpha);

If you don't have Pro...

draw_sprite(sprite_index,image_index,x,y);


Next, is the color of the object on the map.

draw_set_color(**color here**);


Then, you draw the shape.

For an ellipse...

draw_ellipse(view_xview[map_view]+horizontal_indent+x/map_size,
view_yview[map_view]+vertical_indent+y/map_size,view_xview[map_view]
+horizontal_indent+x/map_size+sprite_width/map_size,view_yview[map_view]
+vertical_indent+y/map_size+sprite_height/map_size,false);

For a rectangle...

draw_rectangle(view_xview[map_view]+horizontal_indent+x/map_size,
view_yview[map_view]+vertical_indent+y/map_size,view_xview[map_view]
+horizontal_indent+x/map_size+sprite_width/map_size,view_yview[map_view]
+vertical_indent+y/map_size+sprite_height/map_size,false);

For a sprite...
-Pro

draw_sprite_ext(sprite_index,image_index,view_xview[map_view]+horizontal_indent+x/map_size,
view_yview[map_view]+vertical_indent+y/map_size,image_xscale/map_size*sprite_width,
image_yscale/map_size*sprite_height,image_angle,image_blend,ima
ge_aplha);

-Lite

draw_sprite_stretched(sprite_index,image_index,view_xview[map_view]+horizontal_indent+x/map_size,
view_yview[map_view]+vertical_indent+y/map_size,image_xscale/map_size*sprite_width,
image_yscale/map_size*sprite_height);

---Background---

draw_set_alpha(back_alpha);
draw_set_color(back_color);
draw_rectangle(view_xview[map_view]+horizontal_indent,view_yview[map_view]+vertical_indent,view_xview[map_view]+horizontal_indent+room_width/map_size,view_yview[map_view]+vertical_indent+room_height/map_size,false);

---Constants---
Constant | Default Value
map_size | 16
back_color    | c_dkgray
back_alpha | 0.5
map_view | 0
horizontal_indent | 5
vertical_indent | 5
*/


This post has been edited by jimn346: Nov 7 2009, 04:54 PM
Go to the top of the page
 
+Quote Post
ProgWare
post Sep 28 2009, 11:19 AM
Post #2


GMC Member
Group Icon

Group: GMC Member
Posts: 111
Joined: 27-April 09
From: Morocco
Member No.: 132405



Good!

Go to the top of the page
 
+Quote Post
loverock125
post Sep 29 2009, 03:44 PM
Post #3


GMC Member
Group Icon

Group: GMC Member
Posts: 279
Joined: 24-March 09
Member No.: 130455



Hmm it does create a minimap,but you should make it easier to edit it by using variables in the create event,that way if someone wants to adjust it the way he wants,he would only have to change the create variables of an object.But as far as it works,people may want to use this smile.gif

This post has been edited by loverock125: Sep 29 2009, 03:44 PM
Go to the top of the page
 
+Quote Post
nemsisstars
post Sep 30 2009, 10:24 PM
Post #4


GMC Member
Group Icon

Group: GMC Member
Posts: 45
Joined: 23-August 09
Member No.: 138409



How do you edit the map?
Go to the top of the page
 
+Quote Post
jimn346
post Oct 1 2009, 11:54 PM
Post #5


GMC Member
Group Icon

Group: GMC Member
Posts: 170
Joined: 13-April 09
Member No.: 131573



I'll add constants that you can edit in the global game settings.

EDIT: Added constants and instructions.

This post has been edited by jimn346: Oct 2 2009, 12:48 AM
Go to the top of the page
 
+Quote Post
jimn346
post Nov 6 2009, 02:12 AM
Post #6


GMC Member
Group Icon

Group: GMC Member
Posts: 170
Joined: 13-April 09
Member No.: 131573



Added mini-map sprites.
Go to the top of the page
 
+Quote Post
SMP
post Nov 6 2009, 11:14 PM
Post #7


President
Group Icon

Group: GMC Member
Posts: 14
Joined: 23-October 07
From: USA
Member No.: 91398



QUOTE (jimn346 @ Sep 26 2009, 01:40 PM) *
  • Title: Mini-Map Example
  • Description: A simple and easy to edit mini-map example
  • GM Version: GM7.gif
  • Registered: No
  • File Type: .gmk
  • File Size: 19.2 KB (19,687 bytes)
  • File Link:
  • Screenshot:


To change the size of the map, change the constant map_size in the global game settings. The lower the variable, the larger the map.

Please post reviews. wink1.gif


Nice tutorial, but do you have to use constants? rolleyes.gif
Go to the top of the page
 
+Quote Post
Ceryt56
post Nov 6 2009, 11:19 PM
Post #8


GMC Member
Group Icon

Group: GMC Member
Posts: 75
Joined: 15-July 09
Member No.: 136564



Do you have any tutorials?
Go to the top of the page
 
+Quote Post
MegaByte Games
post Nov 7 2009, 12:58 PM
Post #9


GMC Member
Group Icon

Group: GMC Member
Posts: 160
Joined: 5-November 09
From: Corby ~ England
Member No.: 144303



This is awesome, but also very simple biggrin.gif
Go to the top of the page
 
+Quote Post
Ceryt56
post Nov 7 2009, 02:33 PM
Post #10


GMC Member
Group Icon

Group: GMC Member
Posts: 75
Joined: 15-July 09
Member No.: 136564



I don't want to download it but can you please post a list? I don't want that crappy virus again. (I got rid of it before I shut down. Yeah.. tongue.gif )
Go to the top of the page
 
+Quote Post
jimn346
post Nov 7 2009, 05:05 PM
Post #11


GMC Member
Group Icon

Group: GMC Member
Posts: 170
Joined: 13-April 09
Member No.: 131573



QUOTE (Ceryt56 @ Nov 7 2009, 08:33 AM) *
I don't want to download it but can you please post a list? I don't want that crappy virus again. (I got rid of it before I shut down. Yeah.. tongue.gif )

Added List
Go to the top of the page
 
+Quote Post
Ceryt56
post Nov 7 2009, 06:23 PM
Post #12


GMC Member
Group Icon

Group: GMC Member
Posts: 75
Joined: 15-July 09
Member No.: 136564



Also does the code work with 6.1 PRO?
Go to the top of the page
 
+Quote Post
jimn346
post Nov 8 2009, 01:22 AM
Post #13


GMC Member
Group Icon

Group: GMC Member
Posts: 170
Joined: 13-April 09
Member No.: 131573



QUOTE (Ceryt56 @ Nov 7 2009, 12:23 PM) *
Also does the code work with 6.1 PRO?

I don't know, but probably.
Go to the top of the page
 
+Quote Post
Supertramp
post Nov 9 2009, 04:59 PM
Post #14


GMC Member
Group Icon

Group: GMC Member
Posts: 324
Joined: 19-February 07
From: England
Member No.: 71209



nice idea. i would suggest using constants in the create as i have in my minimap turorial, it makes it less complicated and easier for new people to understand
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 22nd November 2009 - 11:44 AM