Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Create Event:
- ///Init Shop
- posIn=x
- posOut=x
- YposOut=y
- YposIn=y
- shop=false
- cost1=500
- cost2=1250
- cost3=10
- cost4=20
- cost5=2500
- cost6=10000000
- cost7=50
- cost8=100
- GridWidth=0
- layer=2
- i1=res_shop_tophat
- i2=res_shop_blush
- i3=res_shop_clicks
- i4=res_shop_sec
- i5=res_shop_superPaws
- i6=res_shop_whatsThis
- i7=res_shop_empty
- i8=res_shop_empty
- i9=res_shop_clicksPlus
- i10=res_shop_secPlus
- i11=res_shop_empty
- i12=res_shop_empty
- //Item Setup 0:Sprite, 1:Name, 2:Price, 3:Desc., 4:sold out
- Item=ds_grid_create(12,5)
- Item[# 0,0]=i1
- Item[# 0,1]="Tophat"
- Item[# 0,2]=cost1
- Item[# 0,3]="A snazzy tophat that doubles Paws."
- Item[# 0,4]=false
- Item[# 1,0]=i2
- Item[# 1,1]="Blushies"
- Item[# 1,2]=cost2
- Item[# 1,3]="More Cuteness = More Paws; x2 Paws"
- Item[# 1,4]=false
- Item[# 2,0]=i3
- Item[# 2,1]="Stronger Paws"
- Item[# 2,2]=cost3
- Item[# 2,3]="More Paws per click"
- Item[# 2,4]=false
- Item[# 3,0]=i4
- Item[# 3,1]="Helping Paws"
- Item[# 3,2]=cost4
- Item[# 3,3]="More Paws per second"
- Item[# 3,4]=false
- Item[# 4,0]=i5
- Item[# 4,1]="Super Paws"
- Item[# 4,2]=cost5
- Item[# 4,3]="Allows click and hold, upgrade further to hold longer"
- Item[# 4,4]=false
- Item[# 5,0]=i6
- Item[# 5,1]="???"
- Item[# 5,2]=cost6
- Item[# 5,3]="OwO Whats This?"
- Item[# 5,4]=false
- Item[# 6,0]=i7
- Item[# 6,1]=""
- Item[# 6,2]=""
- Item[# 6,3]=""
- Item[# 6,4]=false
- Item[# 7,0]=i8
- Item[# 7,1]=""
- Item[# 7,2]=""
- Item[# 7,3]=""
- Item[# 7,4]=false
- Item[# 8,0]=i9
- Item[# 8,1]="Stronger Paws+"
- Item[# 8,2]=cost7
- Item[# 8,3]="Even More Paws per click"
- Item[# 8,4]=false
- Item[# 9,0]=i10
- Item[# 9,1]="Helping Paws+"
- Item[# 9,2]=cost8
- Item[# 9,3]="Even More Paws per second"
- Item[# 9,4]=false
- Item[# 10,0]=i11
- Item[# 10,1]=""
- Item[# 10,2]=""
- Item[# 10,3]=""
- Item[# 10,4]=false
- Item[# 11,0]=i12
- Item[# 11,1]=""
- Item[# 11,2]=""
- Item[# 11,3]=""
- Item[# 11,4]=false
- Pos[0]=x
- Pos[1]=x
- Pos[2]=x
- Pos[3]=x
- Pos[4]=x
- Pos[5]=x
- Pos[6]=x
- Pos[7]=x
- Pos[8]=x
- Pos[9]=x
- Pos[10]=x
- Pos[11]=x
- PosY[0]=y
- PosY[1]=y
- PosY[2]=y
- PosY[3]=y
- PosY[4]=y
- PosY[5]=y
- PosY[6]=y
- PosY[7]=y
- PosY[8]=y
- PosY[9]=y
- PosY[10]=y
- PosY[11]=y
- //Left Pressed Event:
- if shop=false {shop=true audio_play_sound(sound_options,0,0)}
- else
- if shop=true {shop=false audio_play_sound(sound_close,0,0)}
- Draw Event:
- ///Shop Stuff
- var i2=0
- //Setup Icon Arrangement -- A second for loop was here, but I removed it, hence the var i2=0
- for(i=0; i<ds_grid_width(Item); i++;)
- {
- //Draw Shop Icons
- if Pos[i+(0)]>x+0.25 and PosY[i2]<y+0.25
- {
- draw_sprite(Item[# i+(0),0],0,Pos[i+(0)],PosY[i2])
- //draw_text(Pos[i+(0)],PosY[i2],i+(0)) --Item Placement Debug
- if Item[# i+(0),4]=true {draw_sprite_ext(Item[# i+(0),0],0,Pos[i+(0)],PosY[i2],1,1,0,c_dkgray,1)}
- }
- //Draw Notify Icon On Shop Icon If Not Shopping
- if shop=false {if global.Paws>=Item[# i+(0),2] {draw_sprite(res_notify,0,x+sprite_width/2,y-sprite_width/2)} }
- //Move Shop Icons Out
- if shop=true
- {
- Pos[i+(0)]=lerp(Pos[i+(0)],(posOut+46)+(34*(i+(0))),0.125)
- PosY[i2]=lerp(PosY[i2],(YposOut)-(34*i2),0.125)
- //Display Info When Moused Over
- if (mouse_x>(Pos[i+(0)]-16) and mouse_x<(Pos[i+(0)]-16)+32) and (mouse_y>(PosY[i2]-16) and mouse_y<(PosY[i2]-16)+32)
- {
- draw_set_font(global.font) //Change this, this is a custom font I made
- draw_set_colour(c_white)
- draw_text(2,PosY[i2]-80,Item[# i+(0),1])
- ladder(Item[# i+(0),2],"Paws:",2,PosY[i2]-64)
- draw_text(2,PosY[i2]-48,Item[# i+(0),3])
- draw_set_font(-1)
- draw_set_colour(c_white)
- }
- //Draw Notify Icon On Relative Icons If Shopping
- if global.Paws>=Item[# i+(0),2] and Item[# i+(0),4]=false {draw_sprite(res_notify,0,Pos[i+(0)]+16,PosY[i2]-16)}
- }
- else
- //Move Shop Icons In
- if shop=false
- {
- Pos[i+(0)]=lerp(Pos[i+(0)],posIn,0.125)
- PosY[i2]=lerp(PosY[i2],YposIn,0.125)
- }
- }
- //Buying Stuff
- if shop=true
- {
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[0]-16) and mouse_x<(Pos[0]-16)+32) and (mouse_y>(PosY[0]-16) and mouse_y<(PosY[0]-16)+32)
- {
- if global.Paws>=Shoppe.cost1 and Item[# 0,4]=false {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost1 global.Tophat=true Item[# 0,4]=true Item[# 0,2]=0 Item[# 0,3]="Sold Out"}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[1]-16) and mouse_x<(Pos[1]-16)+32) and (mouse_y>(PosY[1]-16) and mouse_y<(PosY[1]-16)+32)
- {
- if global.Paws>=Shoppe.cost2 and Item[# 1,4]=false {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost2 global.Blush=true Item[# 1,4]=true Item[# 1,2]=0 Item[# 1,3]="Sold Out"}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[2]-16) and mouse_x<(Pos[2]-16)+32) and (mouse_y>(PosY[2]-16) and mouse_y<(PosY[2]-16)+32)
- {
- if global.Paws>=Shoppe.cost3 {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost3 global.PawClick+=1 Shoppe.cost3+=floor(cost3*global.Tax) Item[# 2,2]=cost3}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[3]-16) and mouse_x<(Pos[3]-16)+32) and (mouse_y>(PosY[3]-16) and mouse_y<(PosY[3]-16)+32)
- {
- if global.Paws>=Shoppe.cost4 {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost4 global.PawSec+=1 Shoppe.cost4+=floor(cost4*global.Tax) Item[# 3,2]=cost4}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[4]-16) and mouse_x<(Pos[4]-16)+32) and (mouse_y>(PosY[4]-16) and mouse_y<(PosY[4]-16)+32)
- {
- if global.Paws>=Shoppe.cost5 {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost5 OwO.HoldMax+=10 OwO.PawHold=OwO.HoldMax Shoppe.cost5+=floor(cost5*global.Tax) Item[# 4,2]=cost5 }
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[5]-16) and mouse_x<(Pos[5]-16)+32) and (mouse_y>(PosY[5]-16) and mouse_y<(PosY[5]-16)+32)
- {
- if global.Paws>=Shoppe.cost6 and Item[# 5,4]=false {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost6 global.What=true Item[# 5,4]=true Item[# 5,2]=0 Item[# 5,3]="Sold Out"}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[8]-16) and mouse_x<(Pos[8]-16)+32) and (mouse_y>(PosY[8]-16) and mouse_y<(PosY[8]-16)+32)
- {
- if global.Paws>=Shoppe.cost7 {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost7 global.PawClick+=2 Shoppe.cost7+=floor(cost3*global.Tax) Item[# 8,2]=cost7}
- }
- if mouse_check_button_pressed(mb_left) and (mouse_x>(Pos[9]-16) and mouse_x<(Pos[9]-16)+32) and (mouse_y>(PosY[9]-16) and mouse_y<(PosY[9]-16)+32)
- {
- if global.Paws>=Shoppe.cost8 {audio_play_sound(sound_buy,0,0) global.Paws-=Shoppe.cost8 global.PawSec+=2 Shoppe.cost8+=floor(cost4*global.Tax) Item[# 9,2]=cost8}
- }
- }
- draw_self()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement