GameMaker: Studio - Your first game 5: Score Tracking
Вставка
- Опубліковано 26 лип 2024
- A GameMaker tutorial for absolute beginners to go from nothing to a completed game using GML scripting, no experience necessary!
Playlist: • Your first GameMaker Game
www.gamemakertutorials.com/
/ shaunspalding
shaunspalding.co.uk/
I'm working on a visual novel type game where the choices you make trigger different endings. I figured the easiest way to do that was with a point system. Thanks to your tutorial I was able to set up global point tracking through multiple rooms! Now the button with the choice has a point value, and the score determines the ending you get. I even got the "tally" button functioning so it pulls if score, get score, if x go to this room - else, if score, get score, if x go to this room ect so the different scores send you to the different ending! I'm so excited I didn't think I would get BOTH score tracking and score tally = specific ending set up so quickly and your tutorial was a huge help
I'm addicted to my own game
now thats what i call living the dream!
lol
lmao
I've been going through this since the Humble Bundle, and I just want to say these tutorials are fantastic, educational and easy as hell to follow. I feel like even if I didn't have a headstart on programming logic I would easily get what you're talking about.
You are enabling me to have a smooth introduction into game design, and making games is absolutely one of my dreams. Thank you.
I must agree. I also got it in the bundle , and as somebody who has only ever rarely worked with code and messed about in scratch , these tutorials are fantastic .
same :D very nice tutorial
I agree too, I have been learning programming on a raspberry Pi for about a year (in Python) and the full on coding process is almost overwhelming for a simple game (to a newbie), this has been a breath of fresh air in comparison - But - it has also taught me the structure and mechanics of game development, and I know a lot more now thanks to Shauns explanations - I am confident I can accomplish more now in Python and Pygame by knowing these things - the only difference is syntax, and having to type from scratch instead of drag'n'drop
Amazing lessons
Lol I bought it in the bundle 3 years ago and I'm just getting to it now :)
Shaun, you're such a fucking champ.
Oh my god, thank you so much Shaun! You're a lifesaver. I got stuck on this as I wanted to increase the score by 100 every time an enemy died, but it wouldn't go past 100. Thank you so much for helping me solve this!
You legend, thanks so much for helping me and teaching me game maker, I don't actually use this series I use your platformer series for help and I would like to appreciate your efforts of how much you actually help me, I was trying to do a score myself and I got errors and I watch this tutorial and in about 5 minutes I have a working score! Thanks Shaun ;)
I'm laughing so hard. I fucked my own game so bad.
Remember how Shaun made the Potato variable?
I changed it to global.potato.
and whenever my ship hits an asteroid, global.potato adds another 50,000,000,000 to itself.
Which crashed my game.
XD
Nice! Lol
potato overdose xD
Thank you so much for these tutorials. I feel like I have learned so much in an hour, even more than I did from other tutorials that I tried following across 2 days.
Thank you so much for making these videos! They have been super helpful and I really appreciate it!
Following this tutorials are amazing I feel like I have learned a lot
Shaun, you helped me a lot! Thank you for videos and, please, continue making more awesome and helpful tutorials :D Thanks!
great job I did put a little twist as we go on working perfectly. so far
global.friends = 0;
:(
Friends are overrated.
+Thomas Luijkman global.fucks = 0;
+Error 404 account not found ayy lmao
+Thomas Luijkman Who needs friends when you got knives.
global.friends = 3;
absolutely brilliant! thank you!
This is cool.
I have added some text on the room, just simple text, that say "TEST BUILD V0.0.1" or something and "MADE BY JASCU ALEX" so if people play my game, yeah.
Really useful tutorials. :)
How do you make the score follow an object? say for example like a platformer
Yo shaun loving the videos man, my asteroids style game is coming on nicely and I honestly think I could do it again from scratch without re-checking the videos, very very thorough and well paced. I do however have a question and I apologies if this is covered in another video but basically due to the fact I am using a piece of art I found for the background as opposed to just plain black I need to make my score counter more bigger and bolder. Ideally I want to change the font to Curlz_MT as well. How would I go about doing this ? many thanks dude
thank you again great job
dude thanks alot! u r the best
Hi Shaun, ive followed this and made a asteroid type game.... just one thing.... how do i sort waves out...ie when i get to 2000 points move to harder(more asteroids etc)?
For some reason, though I have wrap both ways on all my asteroids, some disappear if they leave the screen at an awkward angle.
So I threw wrap into the step event and it fixed it.
thanks a lot for this video. It's so good video with tutorial for coding for score and draw it but i still have some wonders. Could you show me the way to show the high score screen?
Keep making more
potato=7 shaun-2016... ty for the tutorial :) rlly enjoing
I finished this tutorial and I made it so that every time you fire it deducts 5 points from your score, making accuracy give you lots of points if you finish
been thinkn of trying to make this into a full game with bosses etc have some ideas from the code wev been using so far and some from your platformer tuts
It Came Up With A Fatal Error But I Fixed It By My Self And Now I Feel Smart :3
+THE GAVIN SPY How did you fix it?
Ryan Olson Sorry I Can't Remember But I Will Try To Because I'm Not Mean :D
Good stuff thanks ;)
I'm currently doing a trivia game for a class project. I want the score to be drawn on one room and for my actions on the other rooms to impact the score. I've been struggling to do this.
Thanks - Awesome set of tutorials - I followed this and was able to personalise the sprites by adding a lil ship and a spacey background - I just wanted to know...how do I make it restart or finish when all the asteroids are shot? I want it to either restart, or say Level Clear - Score 1000 Pts for example
Ive just seen the same question below....sorry, will see how that goes now
I used the alarms to make the score increase by 1 every half a second if the speed is max as to reward the player for moving on max speed.
(obj_player)
//event "Create"
alarm[0]=30
//event "Alarm 0"
if(speed >= 4.99) global.points = global.points + 1
alarm[0]=30
Question, how would you make the score continue from one room to the next? I have made it when you destroy all asteroids, it moves to another room where you shoot 3 bullets. But my score resets.
really usefull tutorial
My score will not draw. I have an obj_score with a 'Create' event and an action of 'global.points = 0;'.
I also have a 'Draw' event in the same obj_score with code 'draw_text(32,32,global.points);' (I don't care if the font is black, background is grey).
I have placed this obj_score within my rm_main, but when I run, nothing is drawn, no 0, no nothing. What am I missing?
Same here dure :(
So I assume that the Draw event is like a step event, something that happens every frame, but it's to make something visible instead of what you would normally put into a step event (logic for an object)?
Cheers mate
Thank you for this really helpful series! :) May I ask you a question?
I have a shooting game with different levels, and I want to count the score all together. But everytime when the first level is won and Game Maker changes to the next room, the score again is at 0.
How can I fix it, so that I start with the score from the last room?
I'm having a similar problem, when I enter a new room after getting points it goes back to 0, however, if i go through the room, then go back and get points it holds onto the points if the rooms and obj_points are set to persistent. not sure how I would right it (I'm a newbie) but if you could do something like something to check current room score so when you go to a new room it will add to it. global.points = global.points (currentx) + 0. Then you can change 0 to whatever if you want to give the player points for completing the room. I have no idea how to write it though.
found out what to do, make the obj_points persistent and only put it into the first room. it doesn't need to go in every room because when you do, you're telling the game to make a new global.points again when it's already being carried through the rooms. hope this helps.
finally i got an answer. thank you for help.
is so good!!!!!!!!!!!!
Is there some way to replace the drag and drop actions window with a window that simply displays code.
I'm making a game using this score system. Is there a way to keep the same score when I transition between one room to another?
how can i save a score or add it to another number? i want to use the points as money to upgrade your player in a shop so i need it to where you can have a money system
I wonder if someone can help. When I want to decrement a score count when enemy hits the player how do i do that? When I use global.points -= 1 it works but if the enemy collides with the player it decrements the whole score and not 1. Can someone help me with this?
Shaun or any one, is there a way to make it so your global variable don't reset when the room restarts? If there is it would be vary helpful! Thanks
hey if i wanted a different type of enemy to spawn at some random value how would i do that? lets say at 20 points i want another set of enemies to appear? is that in the spawner? is it just another if statement?
hello, i was wondering if i can have some help with a problem i have going on,
i've made a system that checks for the existence of my enemy, i was wondering if i can have it set like this?
if (instance_exists(obj_enemy) && (obj_enemy_faller));
{
//do nothing at all
}
else
{
action_create_object(Obj_Goal,0,0);
}
at the minute its complaining at me saying that the "else" has a mistake in the second position, i was wondering if anyone can help?
I've been folowing your tutorials since yesterday and everything has been going great. I do have one question and i'm hoping i didnt just miss it in this video but could you tell me how to make it so points dont go lower than 0? I added in my point system and made it so every time a bullet leaves the screen and gets destroyed it will subtract points to make it more accuracy oriented but i dont know how to make it so points dont go in the negatives
+Oshen Phillips Maybe with : if (score < 0) {
score = 0;} ? maybe that works haven't tried it for myself so sry if not
+MagicAscend i think it should be like the speed score - 0.01 = score =0;
I do not realy know
And i have no experience either except this beautiful tutorials!
Shaun how do you make the score bigger, like the size of the object, so the numbers can be seen better then the small numbers in the corner
if i want o draw a phrase instead of the score, wich function do i use
I need some help with the score, when I shoot the big asteroid the points add up normally. However when I shoot a smaller asteroid, the points fall back to zero. Then the points keep going back to One and Zero over and over again. I'm not to sure what to do about it
I have GM studio standard 1.4 edition and after I made the invisible sore object, it wouldn't let me run the game.
after this tutorial i have had this problem:
when i kill the big asteroid i get the points, but if i kill the two smaller ones (doesnt matter which one) my points go to zero, and if i kill another big asteroid i still get the points, and if i shoot at a smaller one, i get to zero again...
how can i rectify this?
If i want to make the asteroid bounce what function i must use?
There's also a score option using the drag and drop method
yeah but the point of his serie is to learn to code and not to click on a mouse and release that click .
How do you make sure the score object never gets hidden under asteroid sprites?
So im continuing off of the other videos where we made a game like Galaga. I am trying to add score to that game, but I am having a few errors such as the score during gameplay automatically displaying 6 when there is no global.points = 6; ANYWHERE or anything with the number 6 at all. And also when i kill the "meteorites" (in my case the enemy ships) they get destroyed, but the score isn't added... it remains at 6 for some strange reason. ??
Hey swan, can you make a video on how to do this with Google Play Services? That would be nice. Or give us an example that has a leader board that works with Google Play services that actually shows the leader board that was developed in Google Play Console.
how can i create and save a high score? +Shaun Spalding
In my game when the player hits the enemy with the bullet the game is supposed to add 1 point to the scoreboard. But when the player hits the enemy again the score stays at 1. Why is that?
Also do a menu and a tutorial for making levels so it gets harder
"potato = 7"
...hey...
I CAN COUNT TO POTATO!
Does anyone have a link to a dnd tutorial for this?
so i wrote the code but it wont show the text on my screen ive reread it and it seems fine not sure what to do
Any ideas on scoreboard?
Shaun, I know this is really late but at 7:14 you had only 1 piece of code, but for me it has 3 create instances and no execute code. what should i do?
how do u make a start screen
I'm making a platformer and the player would earn points by collecting coins. The levels have checkpoints in and everything respawns when the player dies. Including coins. Would there be a way to prevent the coins from respawning on death? I tried setting the room to persistent but that caused a lot of spazzing out whenever the player touched a spike.
Hi Shaun, Excellent tutorial, i'm following along, but i'm making it for html5, and everything has been fine up until now, however html5 seems to not want to let me draw the text, Any ideas?
same thing here
You know what they say...
Ys up!
Wise up!
How to increase the size of the score?
In my game, I have enemy space ships and I need them to randomly spawn across the map and I need the enemies to shoot at the player. Pls help!
How do I make the score to carry onto the next room??. Every time I change rooms, it restarts to zero. Anyone here knows?
How can you make the score fit in a view ?
followed this and i get a glitched look just scribbles of the color and then when I die it then appears. please help.
bellow is the code used for score and life system:
*create:*
global.points = 0;
global.life = 2;
*draw:*
draw_set_halign(fa_left);
draw_set_valign(fa_middle);
draw_set_color(c_silver);
draw_text(64,32,"Score: " + string(global.points));
draw_text(64,64,"Lives: " + string(global.life));
you are a genius.
You prolly dont care at all but does anybody know a trick to get back into an Instagram account?
I was stupid lost the login password. I appreciate any tips you can offer me!
@Everett Guillermo instablaster :)
@Angel Tanner Thanks so much for your reply. I found the site on google and Im in the hacking process now.
Takes quite some time so I will get back to you later with my results.
@Angel Tanner It worked and I now got access to my account again. Im so happy!
Thanks so much you saved my ass :D
@Everett Guillermo You are welcome xD
Is there a way you can have a button that resets everything afterwards?
(After you've destroyed all the asteroids. Or a way to make the asteroids spawn forever?)
make an sprite button then make the sprite into obj then add a event click on mouse then left pressed not left clicked make sure its pressed or it wont work add a piece of code and type
game_restart();
then click done then open up your room where u want the button place the button in one of the corners then it should work tell me if anything is wrong
@@MaxGaming-tx8tg Thanks!! Just used this and it works :)
HEY SHAWN! Any way you can show us how to make a Online Leader board, using Google Play Services? That is the tutorial me and many game developers have been asking for years.
Hey Shaun, my room is a different size and the view is programmed to follow the player, so this doesn't work. How would I get this to work even with my pre-determined view/room/port sizes? Thanks.
Another UA-cam Pooper Never mind! Figured it out! Simply change the event to "DRAW GUI". Unlike the standard "Draw" event, "Draw GUI" is not affected by the pre-determined view/room/port sizes.
shaun i have been following this tutorial and adding my own unique things but i'm asking can i put this game on my website its completed with a menu and wave system i'm asking can i put this on my website if i credit you (its not the same game BTW) thnx
***** have our babies !
***** When I put global.points it says points is not a variable? Any help appreciated, thanks
will do, thanks
Whats your website called?
You might want to make points a variable, by typing in something like "Points = score" or something.
is there a reason to write global.points = global.points + 75, since its a global you can reach it in any object, so writing global.points += 75; would do the same.
how can i change style of text (police)e ????
what about particle effects?
Can you change the font of the score?
They covered that in a future episode, I think it's the dying one.
Guys i need help, everytime i hit my asteroids only 50 points is added but the other asteroids give none even if i gave them the code to do so
I made a simple agar.io but instead the "player" is autonomous and food is spawned whenever one is destroyed and it keeps score for every food eaten, I'm gonna use it as my desktop background.
My score keeps resetting to 0. I will hit the normal asteroids and but it goes back to 0 when I hit a smaller asteroid. How can I fix this?
@shaun spaulding how do u remember these concepts and codes . any tips
Practice but I guess you're a pro coder 3 years later lol
How to make text bigger?
its been a great tutorial, but here is where i got stuck...
when i kill the big asteroid i get the points, but if i kill the two smaller ones (doesnt matter which one) my points go to zero, and if i kill another big asteroid i still get the points, and if i shoot at a smaller one, i get to zero again...
any idea where would my problem be? :/
Hello Shaun, how do I add a text on top of the score? Let's say "Score:" or something.
I'm replying to a one year-old comment but whatever. It might help somebody out.
I had the same problem and to do that simply do this:
draw_text(x, y, "Score: " + string(global.points));
peace out
Well it actually did help someone out, thanks a bunch dude!
Steven Lam
No Problem :)
Can u tell me how to make it where like if there just sitting there and not moving it reduces the amount of points they get (so it encourages them to make it harder/move around)
Just have how much the score is added to based around the player speed by multiplying or adding or something
***** Didnt think of that thanks
how do i add a scoreboard?
i want it attached to the camera, not in the room. how?
i subscribed
I must ask, is there anyway to make the text larger?
You need to go into the fonts folder in your game, and change what size, I think its default 12,
Shaun, I have a problem, when I start the game, the score and the "points:"(watched the newer videos) re-positon almost completely off the screen when I die and stays there when I restart, how can I fix this problem because I used exactly the same things as you did except the sprites and font
BlazingGingerHawk found the problem
how to create levels?
Something happened, I did everything but whenever I hit a normal asteroid my score doesn't change, and if I hit a baby asteroid, it gives me one score, and if I hit another it brings it back to 0.. Someone help.
I want to add the string "score: " in front of global.points so that it would show 'score: 150' for example. I tried putting in "score: "+global.points but it didn't work. What can I do to add this into my game?
Also thanks for the excellent videos, they're really helpful :)
you should make a new object without a sprite then you use the draw event and write this code:
draw_text(x,y,"the text you want")
Any idea on how i can make the asteroids respawn???
***** Thanks
Something weird's happened to gamemaker. I can't save, create a new project, or do anything. What do I do and how do I fix it?