About r2d2upgrade (twitter: @theupgradezone)

I am a programmer, digital artist, rocket jumping fanatic and spy-crabbing extraordinaire

Entries

 
Ludum Dare 29
 
MiniLD 50
 
MiniLD 49
 
MiniLD 48

r2d2upgrade's Trophies

Testing the Transparency of Trophies Award
Awarded by r2d2upgrade
on May 2, 2014
For letting me know about reviews on my game
Awarded by schizokoa
on February 28, 2014

r2d2upgrade's Archive

I haven’t been here in a long time. So I thought I would share this code I made with you and explain how it works (so people who don’t use Gamemaker can reverse-engineer it). Unfortunately I’m not taking part this time round, but I felt like helping those who are!

 

Gamemaker Script Code
Simply copy and paste these into two seperate scripts:

Ring Health Bars
//scr_health_ring(x,y,radius,thickness,maxsegments,segments,startangle,totalangle,direction,colour)

//argument0 = x
//argument1 = y
//argument2 = radius
//argument3 = thickness
//argument4 = maxsegments
//argument5 = segments
//argument6 = startangle
//argument7 = totalangle
//argument8 = direction
//argument9 = colour

anglechange = (argument7/argument4)*(pi/180)
i = argument6*(pi/180)

ax = argument0+(cos(i)*argument2)
ay = argument1-(sin(i)*argument2)

bx = argument0+(cos(i)*(argument2+argument3))
by = argument1-(sin(i)*(argument2+argument3))

repeat(argument5) {
i += argument8 * anglechange

cx = argument0+(cos(i)*argument2)
cy = argument1-(sin(i)*argument2)

dx = argument0+(cos(i)*(argument2+argument3))
dy = argument1-(sin(i)*(argument2+argument3))

draw_triangle_colour(ax,ay,bx,by,dx,dy,argument9,argument9,argument9,0)
draw_triangle_colour(ax,ay,cx,cy,dx,dy,argument9,argument9,argument9,0)

ax = cx
ay = cy

bx = dx
by = dy
}

Circle Health Bars
//scr_health_circle(x,y,radius,maxsegments,segments,startangle,totalangle,direction,colour)

//argument0 = x
//argument1 = y
//argument2 = radius
//argument3 = maxsegments
//argument4 = segments
//argument5 = startangle
//argument6 = totalangle
//argument7 = direction
//argument8 = colour

anglechange = (argument6/argument3)*(pi/180)
i = argument5*(pi/180)

ax = argument0+(cos(i)*argument2)
ay = argument1-(sin(i)*argument2)

repeat(argument4) {
i += argument7 * anglechange

bx = argument0+(cos(i)*argument2)
by = argument1-(sin(i)*argument2)

draw_triangle_colour(ax,ay,bx,by,argument0,argument1,argument8,argument8,argument8,0)

ax = bx
ay = by
}

 

To execute the scripts simply use:
scr_health_ring(x,y,radius,thickness,maxsegments,segments,rotation,angle,direction,colour)
or
scr_health_circle(x,y,radius,maxsegments,segments,rotation,angle,direction,colour)

 

Meet The Variables:

Ring Health bars

x,y = the coordinates of the center of the ring

radius = the distance from the center to the start of the ring

thickness = the thickness of the ring

rotation = at what angle is the zero mark of the ring?

angle = over how many degrees does the ring span?

max segments = how many segments the ring is split in to

segments = how many of those segments are visible

direction = which way is the ring drawn? 1 for anti-clockwise and -1 for clockwise

For the circle health bar the variables are the same except that thickness is not included.

Demo download

A demo (gif):

Circular Health Bars Demo

 

The demo is using two rings; one red and one green to simulate health.

 

What is this sorcery?
When a computer draws a circle, it is actually just a bunch of triangles arranged in the same way as slices of pie.

To find the coordinates of each triangle to be able to draw them we need a big steaming pile of math.

 

Specifically we need some trigonometry. Let’s start with which way is up:

Ring Health bars angles

Or in this case, which way is right: zero degrees.

A new temporary variable, i, will count our current angle as we sweep around the circle.

After each cycle in the loop it will change by the angle variable divided by the maxsegments.

Ring Health bars sections

 

Add to the mix our variables for radius and thickness and we can draw a triangle to work out our x and y coordinates for our triangles to draw!

Ring Health bars triangle

From this we can get the coordinates for the two points a and b. To get point b we simply add the thickness to the radius:

Ring Health bars triangle ab

 

Then we add the angle change to i, and get the variables c and d. Then we can connect the dots and draw one section!

Ring Health bars triangle cd

Ring Health bars section

Repeating this process for how many sections we want to draw will result in a ring!

This process is the same for the circle, except we only need points a, c, and the center for each triangle.

 

Good luck for LD 32! Hopefully this tutorial will come in handy.

I kinda rushed this. Hopefully you can understand it if you have a basic grip on maths.

Why I never took part in this Ludum Dare…

Posted by (twitter: @theupgradezone)
Thursday, December 18th, 2014 1:09 pm

Life_Life

Life_Me

MS paint

woooooo

 

But as a side project I am making a game fit for Steam. So I have that going for me. Which is nice.

Hexagonal Grids!

Posted by (twitter: @theupgradezone)
Wednesday, November 12th, 2014 5:10 am

So, I did the maths on how to draw a perfect hexagon. Now, using the same logic from that
tutorial, in this tutorial I will show you how to make a hexagonal grid!

Maths:
Let’s say we have a hexagon with width a and height b.
(If you used the last tutorial, then the value of a from the last tutorial becomes twice that
value in this tutorial)

HexGrid_001

Now we generate a bunch of hexagons to fill up the screen area.
For this example the point of reference is in the center of the hexagon.

Each hexagon will be 3/4*a to the side of the last one, and b above or below:

HexGrid_002

Remember to keep a and b as whole numbers!

So the screen should look like this: (grey = hexagon, dark grey = overlap)

HexGrid_003

But we need every 2nd column to go up a bit, so that the hexagons interconnect properly.
So we use this equation, where x and y are the coordinates of the center of each hexagon:

HexGrid_004

Now your screen will look like this:

HexGrid_005

Excellent!

Now we can code it!

Pseudo Code:

Initialize:
width = (width of hexagon)
height = (height of hexagon)

Creation Loop:
create hexagon
x = x + (3*width)/4
if edge of screen is reached {
go back to starting edge of screen
y = y + height
}

Creation code for each hexagon:
y = y + mod(sin((90*(x/width))*height/2)

 

 

And there you have a hexagonal grid!

And this is the last of my little group of tutorials :3
Thanks for the comments on how to refine the logic and code of previous tutorials :)

How to draw a perfect Hexagon!

Posted by (twitter: @theupgradezone)
Tuesday, November 11th, 2014 9:55 am

So I did that maths of drawing a perfect octagon. Now, for a perfect hexagon!

Maths:

First, we must imagine a rectangle with width a and height b.
You must now choose which side, a or b, you want to specify.

Hexagon_001

If you specified a, to find b you must use this equation:

Hexagon_002

 

 

If you specified b, to find a you must use this equation:

Hexagon_003

Which can also be written as:

Hexagon_004

Remember to round to the nearest number!

 

Drawing:

Once you have a and b, we need to specify the 6 coordinates.
For this example, the frame of reference is the center of the rectangle.

The top and bottom two are b/2 up or down and a/2 to each side.

Hexagon_005

The two sides are a to the side.

Hexagon_006

Then you draw lines between the coordinates.

Hexagon_007

And there you have a perfect hexagon!

 

Pseudo Code:

Initialize:
// Let’s say we specified the width, a
width = (width of imaginary square)
height = 2 * width * sin(60)

Loop:

coord_1x = x – width/2
coord_1y = y + height/2
coord_2x = x + width/2
coord_2y = y + height/2
coord_3x = x + width
coord_3y = y
coord_4x = x + width/2
coord_4y = y – height/2
coord_5x = x – width/2
coord_5y = y – height/2
coord_6x = x – width
coord_6y = y

Hexagon_008

//draw_line(from_x,from_y,to_x,to_y)
draw_line(coord_1x,coord_1y,coord_2x,coord_2y)
draw_line(coord_2x,coord_2y,coord_3x,coord_3y)
draw_line(coord_3x,coord_3y,coord_4x,coord_4y)
draw_line(coord_4x,coord_4y,coord_5x,coord_5y)
draw_line(coord_5x,coord_5y,coord_6x,coord_6y)
draw_line(coord_6x,coord_6y,coord_1x,coord_1y)

 

And that’s how to draw a perfect hexagon!

Coming soon: Hexagonal grids!

How to draw a Perfect Octagon!

Posted by (twitter: @theupgradezone)
Tuesday, November 11th, 2014 4:45 am

I did some maths while I was bored, and I calculated a way to draw a perfect octagon.
I thought this might come in useful for some of you :3

Warning! Maths ahead!

 

Maths:

Imagine a square, with side length a.

001

Our octagon will fit in this square.

We will call the length of a side of the octagon b.

002

 

Now you put a into this equation:

003

Which can also be written as:

004

And you get b.

Now, round b to the nearest number. We can’t be dealing with fractions of pixels now, can we?

Now you have b, we can draw the octagon.

 

Drawing:

For this example, our reference point will be in the center of the octagon, which is also the center of our imaginary square.

005

Our first 2 co-ordinates will be a/2 up and b/2 to either side.

006

007

For the sides, it will be a/2 to the side and b/2 up or down.

008

Then, draw lines between the co-ordinates to finish the octagon.

009

And there you have a regular octagon!

 

Pseudo code:

Initialize:

size = (length of side of square)
oct_side = round((size*sqrt(2))/(2+sqrt(2)))

Loop:

coord_1x = x – oct_side/2
coord_1y = y + size/2
coord_2x = x + oct_side/2
coord_2y = y + size/2
coord_3x = x + size/2
coord_3y = y + oct_side/2
coord_4x = x + size/2
coord_4y = y – oct_side/2
coord_5x = x + oct_side/2
coord_5y = y – size/2
coord_6x = x – oct_side/2
coord_6y = y – size/2
coord_7x = x – size/2
coord_7y = y – oct_side/2
coord_8x = x – size/2
coord_8y = y + oct_side/2

010

//draw_line(from_x,from_y,to_x,to_y)

draw_line(coord_1x,coord_1y,coord_2x,coord_2y)
draw_line(coord_2x,coord_2y,coord_3x,coord_3y)
draw_line(coord_3x,coord_3y,coord_4x,coord_4y)
draw_line(coord_4x,coord_4y,coord_5x,coord_5y)
draw_line(coord_5x,coord_5y,coord_6x,coord_6y)
draw_line(coord_6x,coord_6y,coord_7x,coord_7y)
draw_line(coord_7x,coord_7y,coord_8x,coord_8y)
draw_line(coord_8x,coord_8y,coord_1x,coord_1y)

 

And that’s how to draw a perfect octagon!

Coming soon: How to draw a perfect hexagon!

 

To those interested in the maths involved to get the equation:

Maths

 

I originally calculated this to be able to draw the Aperture Science logo by hand, but I also saw the use of it on the computer!

I’m in!

Posted by (twitter: @theupgradezone)
Thursday, November 6th, 2014 5:54 am

I will be using Gamemaker!

I recently bought some Xbox controllers, so hopefully my game will have gamepad support!

Its a really nice chrome plated one as well…

Hmmm… shiny…

 

 

Let’s hope the theme is Procrastination, because I would really excel…

:3

Good luck to all!

Unclaimed Trophies!

Posted by (twitter: @theupgradezone)
Tuesday, May 20th, 2014 3:16 am

These people’s pages were ‘not found’ and these are the awards that they won:

48 Hour Compo
drilltail – Innovation 2nd
pixelpun – Graphics 3rd
geekdrums – Audio 1st
brian-corr – Humor 2nd
toki-anholmes – Mood 3rd

Jam
negiyan – Audio 1st
chickadeegames – Humor 2nd
dmcfarline – Humor 3rd
simonlarsen – Mood 1st
simonlarsen – Innovation 1st

Congrats to all of the winners! 😀

New Trophies!

Posted by (twitter: @theupgradezone)
Monday, May 19th, 2014 5:49 am

A recent suggestion from Managore has led to me making some more trophies!

At first there were only gold trophies, but no there are silver and bronze!

Trophy Showcase

 

(Click the image to enlarge)

This means that there will be 60 trophies overall! (48hr compo and jam trophies)

I’ll be busy once the results come out :)

Thanks :)

Trophies are coming!

Posted by (twitter: @theupgradezone)
Sunday, May 18th, 2014 2:23 am

I will start to give out trophies at around 8:00 pm (GMT) on the 20th of May (Tuesday).

Visit the original post here!

Good luck to all! I’ve already seen some awesome games!

Thanks :)

Free Resource Friday Needs Your Help!

Posted by (twitter: @theupgradezone)
Wednesday, May 14th, 2014 2:02 am

Free Resource Friday was supposed to be a weekly thing. But unfortunately, exams happened. So I have run out of time and ideas.

FRF new

Have you got any resources lying around?

  • Music
  • Sound effects
  • Sprites
  • Tutorials
  • Code / engines
  • Programs

If you do and want yours to be shared and help the noobies, contact me, or leave a comment!

Remember to provide the resource or a link!

You will be credited!

Make sure that the resource(s) are royalty free!

Visit the page here

Thanks :)

 

Website Graphics Upgrade

Posted by (twitter: @theupgradezone)
Monday, May 12th, 2014 10:43 am

Not really games related. But graphics related. So close enough.

I’m giving my website a graphics upgrade. Just wanted to know how it looks.

Before:

Downloads 2B

 

After:

Downloads New

(I recommend clicking on the images to see the full size)

Visit the website here

I think it’s better. What about you?

Thanks :)

They get smarter every day…

Posted by (twitter: @theupgradezone)
Tuesday, May 6th, 2014 1:38 pm

This bot posted what seemed to be a legit post:

Screen1

 

But then…

Screen2

The bot goes by the name of 25juta.

And it shall be shot at dawn.

 

Thanks admins, for defending the city of Ludum day and night :)

 

Ride the wave, maaaan!

Posted by (twitter: @theupgradezone)
Wednesday, April 30th, 2014 9:50 am

My entry, Magma Surfer, is done!

I finished it a bit before the deadline, but I just didn’t have time to post this :3

The menu

Screenshot_01

Dodge the rocks!

Screenshot_02

And don’t die!

Screenshot_04

 

My high scores!

 

Screenshot_05

 

I’ve had plenty of positive feedback!

In hindsight, I should have added music. But it’s still fun!

I’ve already seen MANY awesome entries. Good job guys!

 

Also check out the other entry I took part in (I did the graphics for it): Super Scrool Bros by eLLectron

Thanks :)

The bots have become intelligent…

Posted by (twitter: @theupgradezone)
Monday, April 28th, 2014 2:56 am

A bot by the name of  has been posting stupid Game of Thrones series “WATCH FOR FREE” kinda crap. But with titles along the lines of “Ludum Dare 30 Revealed!”.

In short, they have become intelligent, and have bypassed the city walls!

Make this post known!

And prepare the Ban Hammer!

Assasseed’s Crin Featured on Vsauce!

Posted by (twitter: @theupgradezone)
Sunday, April 20th, 2014 10:28 am

Oddly Shaped Pixels’s game Assasseed’s Crin was featured on the popular youtube channel Vsauce!

Congrats to Oddly Shaped Pixels!

See the video here

Go to 3:27 to see it :)

Check out his game here!

Ludum Dare 29 Trophies!

Posted by (twitter: @theupgradezone)
Thursday, April 10th, 2014 8:35 am

This Ludum Dare, I will be giving trophies to the winners of each category.

Which made me think, why not make it a regular thing? Why not automatically give people trophies if they win a category? So that people can see what other people won at a glance.

I think it’s a suggestion worth thinking about. I know it may take time to code but I think it’s a neat idea :)

They also look good. So, they will be a cool thing to have :)

These are the ones I have done so far:

Trophy_Innovation Innovation: A gear, because it is supposed to represent the inner workings of the code

Trophy_FunFun: Balloons and streamers! (Thanks to The4thCircle for the idea)

Trophy_ThemeTheme: A star. Because, I thought that would represent it best

Trophy_GraphicsGraphics: A paint brush and pallet, obviously

Trophy_AudioAudio: A golden record

Trophy_HumorHumor: A jester’s hat (Thanks to PoV for the idea)

Trophy_MoodMood: The iconic happy and sad face from theater

Trophy_OverallOverall: The Ludum Dare Joystick!

Trophy_CommunityCommunity: A globe, because the community is worldwide

Trophy_CoolnessCoolness: Some cool shades (Thanks to Junber for the idea)

 

For each LD challenge, there will be a number on each trophy:

Trophy Number

 

If it is a Jam category, it will have ‘Jam’ on it:

Trophy Jam

So what do you think? A cool idea? Could it be a permanent thing?

Plus, please message me or leave a comment if you have any suggestions!

Thanks :)

[cache: storing page]